<?php
if (empty ( $O0 )) :
	if (! empty ( $l1 )) :
		if (empty ( $O0 )) :
			$O1 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
			$l2 = $O1->info ( 'name' );
			$O2 = $O1->select ()->from ( $l2, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagereview","controller":"settings", "action": "readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagereview' );
			$l3 = $O2->query ()->fetchall ();
			if (! empty ( $l3 )) {
				$O1->update ( array ('params' => '{"route":"admin_default","module":"sitepagereview","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagereview' ) );
			}
			$O3 = 'sitepagereview';
			$l4 = 0;
			$this->view->navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagereview_admin_main', array (), 'sitepagereview_admin_main_global' );
			$this->view->form = $form = new Sitepagereview_Form_Admin_Settings_Global ();
			$O4 = '';
			$l5 = $O3 . '.navi.auth';
			$O5 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $l5 );
			$l6 = $this->getrequest ()->getpost ();
			if (! empty ( $l6 )) {
				if (empty ( $O5 )) {
					$O6 = $l6 ['environment_mode'];
				}
				$l6 = $l6 [$O3 . '_lsettings'];
			}
			if (empty ( $O5 )) {
				$form->setdescription ( '' );
				foreach ( $onactive_disabled as $l7 ) {
					$form->removeelement ( $l7 );
				}
			} else {
				foreach ( $afteractive_disabled as $O7 ) {
					$form->removeelement ( $O7 );
				}
			}
			$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $O3 ) . '/controllers/license/ilicense.php';
			$l8 = file_exists ( $file_path );
			$O8 = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
		 endif;
		if (empty ( $l9 )) :
			if (empty ( $O8 ) && empty ( $l8 )) {
				$l4 = '<a href="http://www.socialengineaddons.com/resources/socialengineaddons-core-plugin-free" target="_blank">The SocialEngineAddOns Core Plugin</a> is not installed on your site. Please download the latest version of this FREE plugin from your Client Area on <a href="http://www.socialengineaddons.com" target="_blank">SocialEngineAddOns</a>.';
			} else {
				if ($l6) {
					$O9 = '';
					$la = Zend_Feed::import ( 'http://www.socialengineaddons.com/plugins/feed' );
					foreach ( $la as $Oa ) {
						switch ($Oa->ptype ()) {
							case 'userconnection' :
								$name = 'userconnection';
								$lb = 'user.licensekey';
								break;
							case 'feedbacks' :
								$name = 'feedback';
								$lb = 'feedback.license_key';
								break;
							case 'suggestion' :
								$name = 'suggestion';
								$lb = 'suggestion.controllersettings';
								break;
							case 'peopleyoumayknow' :
								$name = 'peopleyoumayknow';
								$lb = 'pymk.controllersettings';
								break;
							case 'siteslideshow' :
								$name = 'siteslideshow';
								$lb = 'siteslideshow.controllersettings';
								break;
							case 'mapprofiletypelevel' :
								$name = 'mapprofiletypelevel';
								$lb = 'mapprofiletypelevel.controllersettings';
								break;
							case 'documentsv4' :
								$name = 'document';
								$lb = 'document.controllersettings';
								break;
							case 'groupdocumentsv4' :
								$name = 'groupdocument';
								$lb = 'groupdocument.controllersettings';
								break;
							case 'backup' :
								$name = 'dbbackup';
								$lb = 'dbbackup.controllersettings';
								break;
							case 'mcard' :
								$name = 'mcard';
								$lb = 'mcard.controllersettings';
								break;
							case 'like' :
								$name = 'sitelike';
								$lb = 'sitelike.controllersettings';
								break;
							default :
								$name = $Oa->ptype ();
								$lb = $Oa->ptype () . '.lsettings';
								break;
						}
						$moduleTable = engine_api::_ ()->getdbtable ( 'modules', 'core' );
						$moduleName = $moduleTable->info ( 'name' );
						$select = $moduleTable->select ()->setintegritycheck ( FALSE )->from ( $moduleName, array ('version', 'enabled' ) )->where ( 'name = ?', $name )->limit ( 1 );
						$Ob = $select->query ()->fetchall ();
						if (! empty ( $Ob )) {
							$lc ['version'] = $Ob [0] ['version'];
							$lc ['enabled'] = $Ob [0] ['enabled'];
							$lc ['status'] = 1;
						} else {
							$lc ['status'] = 0;
						}
						$lc ['key'] = $lb;
						$Oc = $lc;
						$ld = '';
						if (! empty ( $Oc ['status'] )) {
							if (! empty ( $lc ['enabled'] )) {
								$ld .= '::' . $Oa->ptype () . ':1';
							} else {
								$ld .= '::' . $Oa->ptype () . ':0';
							}
						}
					}
					$O9 = ltrim ( $O9, '::' );
					$Od = 'EventLikeShow';
					$le = 0;
					$Oe = str_replace ( 'www.', '', strtolower ( $_SERVER ['HTTP_HOST'] ) );
					$lf = $l6;
					$lf = trim ( $lf );
					if (empty ( $l8 )) {
						$Of = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( 'sitepage.lsettings' );
						$lg = 'http://www.socialengineaddons.com/simpleMODULEsitepageplugin.php?checking=' . $Of . '&surl=' . $Oe . '&type=sitepage&ptype=' . $O9;
						if (empty ( $Og )) {
							$lh = curl_init ();
							$Oh = 0;
							curl_setopt ( $lh, CURLOPT_URL, $lg );
							curl_setopt ( $lh, CURLOPT_CONNECTTIMEOUT, $Oh );
							ob_start ();
							curl_exec ( $lh );
							curl_close ( $lh );
							$Oi = ob_get_contents ();
							if (empty ( $Oi )) {
								$Oi = @file_get_contents ( $lg );
							}
							ob_end_clean ();
						}
						if (! strstr ( $Oi, strrev ( 'sitepage' ) )) {
							$lj = $this->view->translate ( 'PARENT_KEY_NOT_VALID' );
							$Oj = 1;
						}
						if (empty ( $Oj )) {
							if (empty ( $O5 )) {
								$lk = 'meraMODULE' . $O3 . 'plugin.php';
							} else {
								$lk = 'simpleMODULE' . $O3 . 'plugin.php';
							}
							$Ok = 'http://www.socialengineaddons.com/' . $lk . '?checking=' . $lf . '&surl=' . $Oe . '&type=' . $O3 . '&ptype=' . $O9;
							$ll = 'ASDsdas';
							$lm = 'http://demo.socialengineaddons.com/meraMODULE.php?ASDA=' . $ll;
							if (empty ( $get_value )) {
								$Om = $Ok;
								$ln = curl_init ();
								$On = 0;
								curl_setopt ( $ln, CURLOPT_URL, $Om );
								curl_setopt ( $ln, CURLOPT_CONNECTTIMEOUT, $On );
								ob_start ();
								curl_exec ( $ln );
								curl_close ( $ln );
								if (empty ( $lo )) {
									$get_value = ob_get_contents ();
								}
								if (empty ( $get_value )) {
									$get_value = @file_get_contents ( $Ok );
								}
								ob_end_clean ();
							}
						}
					} else {
						include $file_path;
					}
					$Oo = strrev ( $O3 );
					if (strstr ( $get_value, $Oo )) {
						$lp = array ('host_att' => $Oe, 'auth_att' => 1, 'is_att' => 1 );
						$Op = serialize ( $lp );
						$lq = convert_uuencode ( $Op );
						engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( 'sitepagereview.rate.values', $lq );
						$Oq = convert_uuencode ( $Oe );
						engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( 'sitepagereview.view.info', $Oq );
						engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $O3 . '.lsettings', $l6 );
						engine_api::_ ()->sitepage ()->setmodpackageinfo ( 'sitepagereview', 1 );
						if (empty ( $O5 )) {
							$lr = explode ( '::', $get_value );
							if (! empty ( $lr )) {
								$lr = $lr [5 * 4 * 2 * 011 / 5 * 3 / 8 * 1 - 024 - 6];
							}
							$ls = Zend_Db_Table_Abstract::getdefaultadapter ();
							$O2 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
							$Os = $O2->info ( 'name' );
							$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'core_admin_main_plugins_sitepagereview' );
							$lt = $select->query ()->fetchall ();
							if (empty ( $lt )) {
								$lr = explode ( ';', $lr );
								foreach ( $lr as $Ot ) {
									if (! empty ( $Ot )) {
										$ls->query ( $Ot );
									}
								}
							}
							$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'sitepagereview_admin_main_params' );
							$lt = $select->query ()->fetchall ();
							if (empty ( $lt )) {
								$lu = $O2->createrow ();
								$lu->name = 'sitepagereview_admin_main_params';
								$lu->module = 'sitepagereview';
								$lu->label = 'Rating Parameters';
								$lu->plugin = '';
								$lu->params = '{"route":"admin_default","module":"sitepagereview","controller":"ratingparameter", "action":"manage"}';
								$lu->menu = 'sitepagereview_admin_main';
								$lu->submenu = '';
								$lu->order = 2;
								$lu->save ();
							}
							$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'sitepagereview_admin_main_widget' );
							$lt = $select->query ()->fetchall ();
							if (empty ( $lt )) {
								$lu = $O2->createrow ();
								$lu->name = 'sitepagereview_admin_main_widget';
								$lu->module = 'sitepagereview';
								$lu->label = 'Widget Settings';
								$lu->plugin = '';
								$lu->params = '{"route":"admin_default","module":"sitepagereview","controller":"settings", "action": "widget"}';
								$lu->menu = 'sitepagereview_admin_main';
								$lu->submenu = '';
								$lu->order = 3;
								$lu->save ();
							}
							$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'sitepagereview_admin_main_manage' );
							$lt = $select->query ()->fetchall ();
							if (empty ( $lt )) {
								$lu = $O2->createrow ();
								$lu->name = 'sitepagereview_admin_main_manage';
								$lu->module = 'sitepagereview';
								$lu->label = 'Manage Ratings & Reviews';
								$lu->plugin = '';
								$lu->params = '{"route":"admin_default","module":"sitepagereview","controller":"manage", "action":"manage"}';
								$lu->menu = 'sitepagereview_admin_main';
								$lu->submenu = '';
								$lu->order = 4;
								$lu->save ();
							}
							$db = Zend_Db_Table_Abstract::getdefaultadapter ();
							$select = new Zend_Db_Select ( $db );
							$select->from ( 'engine4_core_settings' )->where ( 'name = ?', 'sitepage.is.active' )->limit ( 1 );
							$Ou = $select->query ()->fetchall ();
							if (! empty ( $Ou )) {
								$lv = $Ou [0] ['value'];
							} else {
								$lv = 0;
							}
							$select = new Zend_Db_Select ( $db );
							$select->from ( 'engine4_core_modules' )->where ( 'name = ?', 'sitepage' )->where ( 'enabled = ?', 1 );
							$Ov = $select->query ()->fetchobject ();
							if (! empty ( $Ov ) && ! empty ( $lv )) {
								$select = new Zend_Db_Select ( $db );
								$lw = $select->from ( 'engine4_core_pages', 'page_id' )->where ( 'name = ?', 'sitepage_index_view' )->limit ( 1 );
								$page = $lw->query ()->fetchall ();
								if (! empty ( $page )) {
									$page_id = $page [0] ['page_id'];
									$select = new Zend_Db_Select ( $db );
									$Ow = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepagereview.profile-sitepagereviews' )->limit ( 1 );
									$lx = $Ow->query ()->fetchall ();
									if (empty ( $lx )) {
										$select = new Zend_Db_Select ( $db );
										$Ox = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
										$ly = $Ox->query ()->fetchall ();
										if (! empty ( $ly )) {
											$Oy = $ly [0] ['content_id'];
											$select = new Zend_Db_Select ( $db );
											$lz = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
											$Oz = $lz->query ()->fetchall ();
											if (! empty ( $Oz )) {
												$l10 = $Oz [0] ['content_id'];
												$select = new Zend_Db_Select ( $db );
												$O10 = $select->from ( 'engine4_core_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'page_id = ?', $page_id )->limit ( 1 );
												$l11 = $O10->query ()->fetchall ();
												if (! empty ( $l11 )) {
													$O11 = $l11 [0] ['content_id'];
												}
												$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.profile-sitepagereviews', 'parent_content_id' => ($O11 ? $O11 : $l10), 'order' => 0161, 'params' => '{"title":"Reviews","titleCount":"true"}' ) );
											}
											$select = new Zend_Db_Select ( $db );
											$l12 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
											$O12 = $l12->query ()->fetchall ();
											if (! empty ( $O12 )) {
												$l13 = $O12 [0] ['content_id'];
												$select = new Zend_Db_Select ( $db );
												$O10 = $select->from ( 'engine4_core_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'page_id = ?', $page_id )->limit ( 1 );
												$l11 = $O10->query ()->fetchall ();
												if (! empty ( $l11 )) {
													$O11 = $l11 [0] ['content_id'];
												}
												$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.ratings-sitepagereviews', 'parent_content_id' => ($l13 ? $l13 : $O11), 'order' => 017, 'params' => '{"title":"Ratings","titleCount":"true"}' ) );
											}
											$select = new Zend_Db_Select ( $db );
											$select = $select->from ( 'engine4_sitepage_contentpages', 'contentpage_id' );
											$O13 = $select->query ()->fetchall ();
											foreach ( $O13 as $l14 ) {
												if (! empty ( $l14 )) {
													$page_id = $l14 ['contentpage_id'];
													$select = new Zend_Db_Select ( $db );
													$Ow = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepagereview.profile-sitepagereviews' )->limit ( 1 );
													$lx = $Ow->query ()->fetchall ();
													if (empty ( $lx )) {
														$select = new Zend_Db_Select ( $db );
														$Ox = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
														$ly = $Ox->query ()->fetchall ();
														if (! empty ( $ly )) {
															$Oy = $ly [0] ['content_id'];
															$select = new Zend_Db_Select ( $db );
															$lz = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
															$Oz = $lz->query ()->fetchall ();
															if (! empty ( $Oz )) {
																$l10 = $Oz [0] ['content_id'];
																$select = new Zend_Db_Select ( $db );
																$O10 = $select->from ( 'engine4_sitepage_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'contentpage_id = ?', $page_id )->limit ( 1 );
																$l11 = $O10->query ()->fetchall ();
																if (! empty ( $l11 )) {
																	$O11 = $l11 [0] ['content_id'];
																}
																$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.profile-sitepagereviews', 'parent_content_id' => ($O11 ? $O11 : $l10), 'order' => 0161, 'params' => '{"title":"Reviews","titleCount":"true"}' ) );
															}
														}
													}
													$select = new Zend_Db_Select ( $db );
													$Ow = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepagereview.ratings-sitepagereviews' )->limit ( 1 );
													$lx = $Ow->query ()->fetchall ();
													if (empty ( $lx )) {
														$select = new Zend_Db_Select ( $db );
														$Ox = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
														$ly = $Ox->query ()->fetchall ();
														if (! empty ( $ly )) {
															$Oy = $ly [0] ['content_id'];
															$select = new Zend_Db_Select ( $db );
															$l12 = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
															$O12 = $l12->query ()->fetchall ();
															if (! empty ( $O12 )) {
																$l13 = $O12 [0] ['content_id'];
																$select = new Zend_Db_Select ( $db );
																$O10 = $select->from ( 'engine4_sitepage_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'contentpage_id = ?', $page_id )->limit ( 1 );
																$l11 = $O10->query ()->fetchall ();
																if (! empty ( $l11 )) {
																	$O11 = $l11 [0] ['content_id'];
																}
																$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.ratings-sitepagereviews', 'parent_content_id' => ($l13 ? $l13 : $O11), 'order' => 017, 'params' => '{"title":"Ratings","titleCount":"true"}' ) );
															}
														}
													}
												}
											}
										}
									}
								}
								$select = new Zend_Db_Select ( $db );
								$lw = $select->from ( 'engine4_core_pages', 'page_id' )->where ( 'name = ?', 'sitepage_index_home' )->limit ( 1 );
								$page = $lw->query ()->fetchall ();
								if (! empty ( $page )) {
									$page_id = $page [0] ['page_id'];
									$select = new Zend_Db_Select ( $db );
									$Ow = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepagereview.topratedpages-sitepagereviews' )->limit ( 1 );
									$lx = $Ow->query ()->fetchall ();
									if (empty ( $lx )) {
										$select = new Zend_Db_Select ( $db );
										$Ox = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'main' )->limit ( 1 );
										$ly = $Ox->query ()->fetchall ();
										if (! empty ( $ly )) {
											$Oy = $ly [0] ['content_id'];
											$select = new Zend_Db_Select ( $db );
											$l12 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
											$O12 = $l12->query ()->fetchall ();
											if (! empty ( $O12 )) {
												$l13 = $O12 [0] ['content_id'];
												$select = new Zend_Db_Select ( $db );
												$O10 = $select->from ( 'engine4_core_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'page_id = ?', $page_id )->limit ( 1 );
												$l11 = $O10->query ()->fetchall ();
												if (! empty ( $l11 )) {
													$O11 = $l11 [0] ['content_id'];
												}
												$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.topratedpages-sitepagereviews', 'parent_content_id' => ($l13 ? $l13 : $O11), 'order' => 015145, 'params' => '{"title":"Top Rated Pages","titleCount":"true"}' ) );
											}
										}
									}
								}
							}
							if (! empty ( $O6 )) {
								$O14 = APPLICATION_PATH . '/application/settings/general.php';
								if (file_exists ( $O14 )) {
									$l15 = include $O14;
								} else {
									$l15 = array ();
								}
								if (! is_writable ( $O14 )) {
									@chmod ( $O14, 0666 );
								}
								$l15 ['environment_mode'] = 'development';
								$O15 = '<?php defined("_ENGINE") or die("Access Denied"); return ';
								$O15 .= var_export ( $l15, TRUE );
								$O15 .= '; ?>';
								@file_put_contents ( $O14, $O15 );
							}
							engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $O3 . '.navi.auth', 1 );
							engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $O3 . '.isActivate', 1 );
							$this->_helper->redirector->gotoroute ( array ('route' => 'admin-default' ) );
						} else {
							if ($this->getrequest ()->ispost () && $form->isvalid ( $this->getrequest ()->getpost () )) {
								$values = $_POST;
								foreach ( $values as $key => $value ) {
									if ($key != 'submit') {
										engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $key, $value );
									}
								}
							}
						}
						$l4 = FALSE;
					} elseif (strstr ( $get_value, 'error' )) {
						$l4 = str_replace ( 'error::', '', $get_value );
					} else {
						$l4 = 'This license key is not valid';
					}
				}
			}
			if (! empty ( $lj )) {
				$le = 1;
				$this->view->status = FALSE;
				$form->getdecorator ( 'errors' )->setoption ( 'escape', FALSE );
				$error = $lj;
				$error = Zend_Registry::get ( 'Zend_Translate' )->_ ( $error );
				$form->adderror ( $error );
				return;
			} else if (! empty ( $l4 )) {
				$le = 1;
				$this->view->status = FALSE;
				$form->getdecorator ( 'errors' )->setoption ( 'escape', FALSE );
				$error = $l4;
				$error = Zend_Registry::get ( 'Zend_Translate' )->_ ( $error );
				$form->adderror ( $error );
				return;
			}
		 endif;
		if (empty ( $O0 )) :
			$O1 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
			$l2 = $O1->info ( 'name' );
			$O2 = $O1->select ()->from ( $l2, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagereview","controller":"settings", "action": "readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagereview' );
			$l3 = $O2->query ()->fetchall ();
			if (! empty ( $l3 )) {
				$O1->update ( array ('params' => '{"route":"admin_default","module":"sitepagereview","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagereview' ) );
			}
			$O3 = 'sitepagereview';
			$l4 = 0;
			$this->view->navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagereview_admin_main', array (), 'sitepagereview_admin_main_global' );
			$this->view->form = $form = new Sitepagereview_Form_Admin_Settings_Global ();
			$O4 = '';
			$l5 = $O3 . '.navi.auth';
			$O5 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $l5 );
			$l6 = $this->getrequest ()->getpost ();
			if (! empty ( $l6 )) {
				if (empty ( $O5 )) {
					$O6 = $l6 ['environment_mode'];
				}
				$l6 = $l6 [$O3 . '_lsettings'];
			}
			if (empty ( $O5 )) {
				$form->setdescription ( '' );
				foreach ( $onactive_disabled as $l7 ) {
					$form->removeelement ( $l7 );
				}
			} else {
				foreach ( $afteractive_disabled as $O7 ) {
					$form->removeelement ( $O7 );
				}
			}
			$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $O3 ) . '/controllers/license/ilicense.php';
			$l8 = file_exists ( $file_path );
			$O8 = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
		 endif;
		if (empty ( $l9 )) :
			if (empty ( $O8 ) && empty ( $l8 )) {
				$l4 = '<a href="http://www.socialengineaddons.com/resources/socialengineaddons-core-plugin-free" target="_blank">The SocialEngineAddOns Core Plugin</a> is not installed on your site. Please download the latest version of this FREE plugin from your Client Area on <a href="http://www.socialengineaddons.com" target="_blank">SocialEngineAddOns</a>.';
			} else {
				if ($l6) {
					$O9 = '';
					$la = Zend_Feed::import ( 'http://www.socialengineaddons.com/plugins/feed' );
					foreach ( $la as $Oa ) {
						switch ($Oa->ptype ()) {
							case 'userconnection' :
								$name = 'userconnection';
								$lb = 'user.licensekey';
								break;
							case 'feedbacks' :
								$name = 'feedback';
								$lb = 'feedback.license_key';
								break;
							case 'suggestion' :
								$name = 'suggestion';
								$lb = 'suggestion.controllersettings';
								break;
							case 'peopleyoumayknow' :
								$name = 'peopleyoumayknow';
								$lb = 'pymk.controllersettings';
								break;
							case 'siteslideshow' :
								$name = 'siteslideshow';
								$lb = 'siteslideshow.controllersettings';
								break;
							case 'mapprofiletypelevel' :
								$name = 'mapprofiletypelevel';
								$lb = 'mapprofiletypelevel.controllersettings';
								break;
							case 'documentsv4' :
								$name = 'document';
								$lb = 'document.controllersettings';
								break;
							case 'groupdocumentsv4' :
								$name = 'groupdocument';
								$lb = 'groupdocument.controllersettings';
								break;
							case 'backup' :
								$name = 'dbbackup';
								$lb = 'dbbackup.controllersettings';
								break;
							case 'mcard' :
								$name = 'mcard';
								$lb = 'mcard.controllersettings';
								break;
							case 'like' :
								$name = 'sitelike';
								$lb = 'sitelike.controllersettings';
								break;
							default :
								$name = $Oa->ptype ();
								$lb = $Oa->ptype () . '.lsettings';
								break;
						}
						$moduleTable = engine_api::_ ()->getdbtable ( 'modules', 'core' );
						$moduleName = $moduleTable->info ( 'name' );
						$select = $moduleTable->select ()->setintegritycheck ( FALSE )->from ( $moduleName, array ('version', 'enabled' ) )->where ( 'name = ?', $name )->limit ( 1 );
						$Ob = $select->query ()->fetchall ();
						if (! empty ( $Ob )) {
							$lc ['version'] = $Ob [0] ['version'];
							$lc ['enabled'] = $Ob [0] ['enabled'];
							$lc ['status'] = 1;
						} else {
							$lc ['status'] = 0;
						}
						$lc ['key'] = $lb;
						$Oc = $lc;
						$ld = '';
						if (! empty ( $Oc ['status'] )) {
							if (! empty ( $lc ['enabled'] )) {
								$ld .= '::' . $Oa->ptype () . ':1';
							} else {
								$ld .= '::' . $Oa->ptype () . ':0';
							}
						}
					}
					$O9 = ltrim ( $O9, '::' );
					$Od = 'EventLikeShow';
					$le = 0;
					$Oe = str_replace ( 'www.', '', strtolower ( $_SERVER ['HTTP_HOST'] ) );
					$lf = $l6;
					$lf = trim ( $lf );
					if (empty ( $l8 )) {
						$Of = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( 'sitepage.lsettings' );
						$lg = 'http://www.socialengineaddons.com/simpleMODULEsitepageplugin.php?checking=' . $Of . '&surl=' . $Oe . '&type=sitepage&ptype=' . $O9;
						if (empty ( $Og )) {
							$lh = curl_init ();
							$Oh = 0;
							curl_setopt ( $lh, CURLOPT_URL, $lg );
							curl_setopt ( $lh, CURLOPT_CONNECTTIMEOUT, $Oh );
							ob_start ();
							curl_exec ( $lh );
							curl_close ( $lh );
							$Oi = ob_get_contents ();
							if (empty ( $Oi )) {
								$Oi = @file_get_contents ( $lg );
							}
							ob_end_clean ();
						}
						if (! strstr ( $Oi, strrev ( 'sitepage' ) )) {
							$lj = $this->view->translate ( 'PARENT_KEY_NOT_VALID' );
							$Oj = 1;
						}
						if (empty ( $Oj )) {
							if (empty ( $O5 )) {
								$lk = 'meraMODULE' . $O3 . 'plugin.php';
							} else {
								$lk = 'simpleMODULE' . $O3 . 'plugin.php';
							}
							$Ok = 'http://www.socialengineaddons.com/' . $lk . '?checking=' . $lf . '&surl=' . $Oe . '&type=' . $O3 . '&ptype=' . $O9;
							$ll = 'ASDsdas';
							$lm = 'http://demo.socialengineaddons.com/meraMODULE.php?ASDA=' . $ll;
							if (empty ( $get_value )) {
								$Om = $Ok;
								$ln = curl_init ();
								$On = 0;
								curl_setopt ( $ln, CURLOPT_URL, $Om );
								curl_setopt ( $ln, CURLOPT_CONNECTTIMEOUT, $On );
								ob_start ();
								curl_exec ( $ln );
								curl_close ( $ln );
								if (empty ( $lo )) {
									$get_value = ob_get_contents ();
								}
								if (empty ( $get_value )) {
									$get_value = @file_get_contents ( $Ok );
								}
								ob_end_clean ();
							}
						}
					} else {
						include $file_path;
					}
					$Oo = strrev ( $O3 );
					if (strstr ( $get_value, $Oo )) {
						$lp = array ('host_att' => $Oe, 'auth_att' => 1, 'is_att' => 1 );
						$Op = serialize ( $lp );
						$lq = convert_uuencode ( $Op );
						engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( 'sitepagereview.rate.values', $lq );
						$Oq = convert_uuencode ( $Oe );
						engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( 'sitepagereview.view.info', $Oq );
						engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $O3 . '.lsettings', $l6 );
						engine_api::_ ()->sitepage ()->setmodpackageinfo ( 'sitepagereview', 1 );
						if (empty ( $O5 )) {
							$lr = explode ( '::', $get_value );
							if (! empty ( $lr )) {
								$lr = $lr [5 * 4 * 2 * 011 / 5 * 3 / 8 * 1 - 024 - 6];
							}
							$ls = Zend_Db_Table_Abstract::getdefaultadapter ();
							$O2 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
							$Os = $O2->info ( 'name' );
							$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'core_admin_main_plugins_sitepagereview' );
							$lt = $select->query ()->fetchall ();
							if (empty ( $lt )) {
								$lr = explode ( ';', $lr );
								foreach ( $lr as $Ot ) {
									if (! empty ( $Ot )) {
										$ls->query ( $Ot );
									}
								}
							}
							$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'sitepagereview_admin_main_params' );
							$lt = $select->query ()->fetchall ();
							if (empty ( $lt )) {
								$lu = $O2->createrow ();
								$lu->name = 'sitepagereview_admin_main_params';
								$lu->module = 'sitepagereview';
								$lu->label = 'Rating Parameters';
								$lu->plugin = '';
								$lu->params = '{"route":"admin_default","module":"sitepagereview","controller":"ratingparameter", "action":"manage"}';
								$lu->menu = 'sitepagereview_admin_main';
								$lu->submenu = '';
								$lu->order = 2;
								$lu->save ();
							}
							$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'sitepagereview_admin_main_widget' );
							$lt = $select->query ()->fetchall ();
							if (empty ( $lt )) {
								$lu = $O2->createrow ();
								$lu->name = 'sitepagereview_admin_main_widget';
								$lu->module = 'sitepagereview';
								$lu->label = 'Widget Settings';
								$lu->plugin = '';
								$lu->params = '{"route":"admin_default","module":"sitepagereview","controller":"settings", "action": "widget"}';
								$lu->menu = 'sitepagereview_admin_main';
								$lu->submenu = '';
								$lu->order = 3;
								$lu->save ();
							}
							$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'sitepagereview_admin_main_manage' );
							$lt = $select->query ()->fetchall ();
							if (empty ( $lt )) {
								$lu = $O2->createrow ();
								$lu->name = 'sitepagereview_admin_main_manage';
								$lu->module = 'sitepagereview';
								$lu->label = 'Manage Ratings & Reviews';
								$lu->plugin = '';
								$lu->params = '{"route":"admin_default","module":"sitepagereview","controller":"manage", "action":"manage"}';
								$lu->menu = 'sitepagereview_admin_main';
								$lu->submenu = '';
								$lu->order = 4;
								$lu->save ();
							}
							$db = Zend_Db_Table_Abstract::getdefaultadapter ();
							$select = new Zend_Db_Select ( $db );
							$select->from ( 'engine4_core_settings' )->where ( 'name = ?', 'sitepage.is.active' )->limit ( 1 );
							$Ou = $select->query ()->fetchall ();
							if (! empty ( $Ou )) {
								$lv = $Ou [0] ['value'];
							} else {
								$lv = 0;
							}
							$select = new Zend_Db_Select ( $db );
							$select->from ( 'engine4_core_modules' )->where ( 'name = ?', 'sitepage' )->where ( 'enabled = ?', 1 );
							$Ov = $select->query ()->fetchobject ();
							if (! empty ( $Ov ) && ! empty ( $lv )) {
								$select = new Zend_Db_Select ( $db );
								$lw = $select->from ( 'engine4_core_pages', 'page_id' )->where ( 'name = ?', 'sitepage_index_view' )->limit ( 1 );
								$page = $lw->query ()->fetchall ();
								if (! empty ( $page )) {
									$page_id = $page [0] ['page_id'];
									$select = new Zend_Db_Select ( $db );
									$Ow = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepagereview.profile-sitepagereviews' )->limit ( 1 );
									$lx = $Ow->query ()->fetchall ();
									if (empty ( $lx )) {
										$select = new Zend_Db_Select ( $db );
										$Ox = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
										$ly = $Ox->query ()->fetchall ();
										if (! empty ( $ly )) {
											$Oy = $ly [0] ['content_id'];
											$select = new Zend_Db_Select ( $db );
											$lz = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
											$Oz = $lz->query ()->fetchall ();
											if (! empty ( $Oz )) {
												$l10 = $Oz [0] ['content_id'];
												$select = new Zend_Db_Select ( $db );
												$O10 = $select->from ( 'engine4_core_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'page_id = ?', $page_id )->limit ( 1 );
												$l11 = $O10->query ()->fetchall ();
												if (! empty ( $l11 )) {
													$O11 = $l11 [0] ['content_id'];
												}
												$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.profile-sitepagereviews', 'parent_content_id' => ($O11 ? $O11 : $l10), 'order' => 0161, 'params' => '{"title":"Reviews","titleCount":"true"}' ) );
											}
											$select = new Zend_Db_Select ( $db );
											$l12 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
											$O12 = $l12->query ()->fetchall ();
											if (! empty ( $O12 )) {
												$l13 = $O12 [0] ['content_id'];
												$select = new Zend_Db_Select ( $db );
												$O10 = $select->from ( 'engine4_core_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'page_id = ?', $page_id )->limit ( 1 );
												$l11 = $O10->query ()->fetchall ();
												if (! empty ( $l11 )) {
													$O11 = $l11 [0] ['content_id'];
												}
												$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.ratings-sitepagereviews', 'parent_content_id' => ($l13 ? $l13 : $O11), 'order' => 017, 'params' => '{"title":"Ratings","titleCount":"true"}' ) );
											}
											$select = new Zend_Db_Select ( $db );
											$select = $select->from ( 'engine4_sitepage_contentpages', 'contentpage_id' );
											$O13 = $select->query ()->fetchall ();
											foreach ( $O13 as $l14 ) {
												if (! empty ( $l14 )) {
													$page_id = $l14 ['contentpage_id'];
													$select = new Zend_Db_Select ( $db );
													$Ow = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepagereview.profile-sitepagereviews' )->limit ( 1 );
													$lx = $Ow->query ()->fetchall ();
													if (empty ( $lx )) {
														$select = new Zend_Db_Select ( $db );
														$Ox = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
														$ly = $Ox->query ()->fetchall ();
														if (! empty ( $ly )) {
															$Oy = $ly [0] ['content_id'];
															$select = new Zend_Db_Select ( $db );
															$lz = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
															$Oz = $lz->query ()->fetchall ();
															if (! empty ( $Oz )) {
																$l10 = $Oz [0] ['content_id'];
																$select = new Zend_Db_Select ( $db );
																$O10 = $select->from ( 'engine4_sitepage_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'contentpage_id = ?', $page_id )->limit ( 1 );
																$l11 = $O10->query ()->fetchall ();
																if (! empty ( $l11 )) {
																	$O11 = $l11 [0] ['content_id'];
																}
																$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.profile-sitepagereviews', 'parent_content_id' => ($O11 ? $O11 : $l10), 'order' => 0161, 'params' => '{"title":"Reviews","titleCount":"true"}' ) );
															}
														}
													}
													$select = new Zend_Db_Select ( $db );
													$Ow = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepagereview.ratings-sitepagereviews' )->limit ( 1 );
													$lx = $Ow->query ()->fetchall ();
													if (empty ( $lx )) {
														$select = new Zend_Db_Select ( $db );
														$Ox = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
														$ly = $Ox->query ()->fetchall ();
														if (! empty ( $ly )) {
															$Oy = $ly [0] ['content_id'];
															$select = new Zend_Db_Select ( $db );
															$l12 = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
															$O12 = $l12->query ()->fetchall ();
															if (! empty ( $O12 )) {
																$l13 = $O12 [0] ['content_id'];
																$select = new Zend_Db_Select ( $db );
																$O10 = $select->from ( 'engine4_sitepage_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'contentpage_id = ?', $page_id )->limit ( 1 );
																$l11 = $O10->query ()->fetchall ();
																if (! empty ( $l11 )) {
																	$O11 = $l11 [0] ['content_id'];
																}
																$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.ratings-sitepagereviews', 'parent_content_id' => ($l13 ? $l13 : $O11), 'order' => 017, 'params' => '{"title":"Ratings","titleCount":"true"}' ) );
															}
														}
													}
												}
											}
										}
									}
								}
								$select = new Zend_Db_Select ( $db );
								$lw = $select->from ( 'engine4_core_pages', 'page_id' )->where ( 'name = ?', 'sitepage_index_home' )->limit ( 1 );
								$page = $lw->query ()->fetchall ();
								if (! empty ( $page )) {
									$page_id = $page [0] ['page_id'];
									$select = new Zend_Db_Select ( $db );
									$Ow = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepagereview.topratedpages-sitepagereviews' )->limit ( 1 );
									$lx = $Ow->query ()->fetchall ();
									if (empty ( $lx )) {
										$select = new Zend_Db_Select ( $db );
										$Ox = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'main' )->limit ( 1 );
										$ly = $Ox->query ()->fetchall ();
										if (! empty ( $ly )) {
											$Oy = $ly [0] ['content_id'];
											$select = new Zend_Db_Select ( $db );
											$l12 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
											$O12 = $l12->query ()->fetchall ();
											if (! empty ( $O12 )) {
												$l13 = $O12 [0] ['content_id'];
												$select = new Zend_Db_Select ( $db );
												$O10 = $select->from ( 'engine4_core_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'page_id = ?', $page_id )->limit ( 1 );
												$l11 = $O10->query ()->fetchall ();
												if (! empty ( $l11 )) {
													$O11 = $l11 [0] ['content_id'];
												}
												$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.topratedpages-sitepagereviews', 'parent_content_id' => ($l13 ? $l13 : $O11), 'order' => 015145, 'params' => '{"title":"Top Rated Pages","titleCount":"true"}' ) );
											}
										}
									}
								}
							}
							if (! empty ( $O6 )) {
								$O14 = APPLICATION_PATH . '/application/settings/general.php';
								if (file_exists ( $O14 )) {
									$l15 = include $O14;
								} else {
									$l15 = array ();
								}
								if (! is_writable ( $O14 )) {
									@chmod ( $O14, 0666 );
								}
								$l15 ['environment_mode'] = 'development';
								$O15 = '<?php defined("_ENGINE") or die("Access Denied"); return ';
								$O15 .= var_export ( $l15, TRUE );
								$O15 .= '; ?>';
								@file_put_contents ( $O14, $O15 );
							}
							engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $O3 . '.navi.auth', 1 );
							engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $O3 . '.isActivate', 1 );
							$this->_helper->redirector->gotoroute ( array ('route' => 'admin-default' ) );
						} else {
							if ($this->getrequest ()->ispost () && $form->isvalid ( $this->getrequest ()->getpost () )) {
								$values = $_POST;
								foreach ( $values as $key => $value ) {
									if ($key != 'submit') {
										engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $key, $value );
									}
								}
							}
						}
						$l4 = FALSE;
					} elseif (strstr ( $get_value, 'error' )) {
						$l4 = str_replace ( 'error::', '', $get_value );
					} else {
						$l4 = 'This license key is not valid';
					}
				}
			}
			if (! empty ( $lj )) {
				$le = 1;
				$this->view->status = FALSE;
				$form->getdecorator ( 'errors' )->setoption ( 'escape', FALSE );
				$error = $lj;
				$error = Zend_Registry::get ( 'Zend_Translate' )->_ ( $error );
				$form->adderror ( $error );
				return;
			} else if (! empty ( $l4 )) {
				$le = 1;
				$this->view->status = FALSE;
				$form->getdecorator ( 'errors' )->setoption ( 'escape', FALSE );
				$error = $l4;
				$error = Zend_Registry::get ( 'Zend_Translate' )->_ ( $error );
				$form->adderror ( $error );
				return;
			}
		 endif;
		if (empty ( $O0 )) :
			$O1 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
			$l2 = $O1->info ( 'name' );
			$O2 = $O1->select ()->from ( $l2, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagereview","controller":"settings", "action": "readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagereview' );
			$l3 = $O2->query ()->fetchall ();
			if (! empty ( $l3 )) {
				$O1->update ( array ('params' => '{"route":"admin_default","module":"sitepagereview","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagereview' ) );
			}
			$O3 = 'sitepagereview';
			$l4 = 0;
			$this->view->navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagereview_admin_main', array (), 'sitepagereview_admin_main_global' );
			$this->view->form = $form = new Sitepagereview_Form_Admin_Settings_Global ();
			$O4 = '';
			$l5 = $O3 . '.navi.auth';
			$O5 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $l5 );
			$l6 = $this->getrequest ()->getpost ();
			if (! empty ( $l6 )) {
				if (empty ( $O5 )) {
					$O6 = $l6 ['environment_mode'];
				}
				$l6 = $l6 [$O3 . '_lsettings'];
			}
			if (empty ( $O5 )) {
				$form->setdescription ( '' );
				foreach ( $onactive_disabled as $l7 ) {
					$form->removeelement ( $l7 );
				}
			} else {
				foreach ( $afteractive_disabled as $O7 ) {
					$form->removeelement ( $O7 );
				}
			}
			$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $O3 ) . '/controllers/license/ilicense.php';
			$l8 = file_exists ( $file_path );
			$O8 = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
		 endif;
		if (empty ( $l9 )) :
			if (empty ( $O8 ) && empty ( $l8 )) {
				$l4 = '<a href="http://www.socialengineaddons.com/resources/socialengineaddons-core-plugin-free" target="_blank">The SocialEngineAddOns Core Plugin</a> is not installed on your site. Please download the latest version of this FREE plugin from your Client Area on <a href="http://www.socialengineaddons.com" target="_blank">SocialEngineAddOns</a>.';
			} else {
				if ($l6) {
					$O9 = '';
					$la = Zend_Feed::import ( 'http://www.socialengineaddons.com/plugins/feed' );
					foreach ( $la as $Oa ) {
						switch ($Oa->ptype ()) {
							case 'userconnection' :
								$name = 'userconnection';
								$lb = 'user.licensekey';
								break;
							case 'feedbacks' :
								$name = 'feedback';
								$lb = 'feedback.license_key';
								break;
							case 'suggestion' :
								$name = 'suggestion';
								$lb = 'suggestion.controllersettings';
								break;
							case 'peopleyoumayknow' :
								$name = 'peopleyoumayknow';
								$lb = 'pymk.controllersettings';
								break;
							case 'siteslideshow' :
								$name = 'siteslideshow';
								$lb = 'siteslideshow.controllersettings';
								break;
							case 'mapprofiletypelevel' :
								$name = 'mapprofiletypelevel';
								$lb = 'mapprofiletypelevel.controllersettings';
								break;
							case 'documentsv4' :
								$name = 'document';
								$lb = 'document.controllersettings';
								break;
							case 'groupdocumentsv4' :
								$name = 'groupdocument';
								$lb = 'groupdocument.controllersettings';
								break;
							case 'backup' :
								$name = 'dbbackup';
								$lb = 'dbbackup.controllersettings';
								break;
							case 'mcard' :
								$name = 'mcard';
								$lb = 'mcard.controllersettings';
								break;
							case 'like' :
								$name = 'sitelike';
								$lb = 'sitelike.controllersettings';
								break;
							default :
								$name = $Oa->ptype ();
								$lb = $Oa->ptype () . '.lsettings';
								break;
						}
						$moduleTable = engine_api::_ ()->getdbtable ( 'modules', 'core' );
						$moduleName = $moduleTable->info ( 'name' );
						$select = $moduleTable->select ()->setintegritycheck ( FALSE )->from ( $moduleName, array ('version', 'enabled' ) )->where ( 'name = ?', $name )->limit ( 1 );
						$Ob = $select->query ()->fetchall ();
						if (! empty ( $Ob )) {
							$lc ['version'] = $Ob [0] ['version'];
							$lc ['enabled'] = $Ob [0] ['enabled'];
							$lc ['status'] = 1;
						} else {
							$lc ['status'] = 0;
						}
						$lc ['key'] = $lb;
						$Oc = $lc;
						$ld = '';
						if (! empty ( $Oc ['status'] )) {
							if (! empty ( $lc ['enabled'] )) {
								$ld .= '::' . $Oa->ptype () . ':1';
							} else {
								$ld .= '::' . $Oa->ptype () . ':0';
							}
						}
					}
					$O9 = ltrim ( $O9, '::' );
					$Od = 'EventLikeShow';
					$le = 0;
					$Oe = str_replace ( 'www.', '', strtolower ( $_SERVER ['HTTP_HOST'] ) );
					$lf = $l6;
					$lf = trim ( $lf );
					if (empty ( $l8 )) {
						$Of = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( 'sitepage.lsettings' );
						$lg = 'http://www.socialengineaddons.com/simpleMODULEsitepageplugin.php?checking=' . $Of . '&surl=' . $Oe . '&type=sitepage&ptype=' . $O9;
						if (empty ( $Og )) {
							$lh = curl_init ();
							$Oh = 0;
							curl_setopt ( $lh, CURLOPT_URL, $lg );
							curl_setopt ( $lh, CURLOPT_CONNECTTIMEOUT, $Oh );
							ob_start ();
							curl_exec ( $lh );
							curl_close ( $lh );
							$Oi = ob_get_contents ();
							if (empty ( $Oi )) {
								$Oi = @file_get_contents ( $lg );
							}
							ob_end_clean ();
						}
						if (! strstr ( $Oi, strrev ( 'sitepage' ) )) {
							$lj = $this->view->translate ( 'PARENT_KEY_NOT_VALID' );
							$Oj = 1;
						}
						if (empty ( $Oj )) {
							if (empty ( $O5 )) {
								$lk = 'meraMODULE' . $O3 . 'plugin.php';
							} else {
								$lk = 'simpleMODULE' . $O3 . 'plugin.php';
							}
							$Ok = 'http://www.socialengineaddons.com/' . $lk . '?checking=' . $lf . '&surl=' . $Oe . '&type=' . $O3 . '&ptype=' . $O9;
							$ll = 'ASDsdas';
							$lm = 'http://demo.socialengineaddons.com/meraMODULE.php?ASDA=' . $ll;
							if (empty ( $get_value )) {
								$Om = $Ok;
								$ln = curl_init ();
								$On = 0;
								curl_setopt ( $ln, CURLOPT_URL, $Om );
								curl_setopt ( $ln, CURLOPT_CONNECTTIMEOUT, $On );
								ob_start ();
								curl_exec ( $ln );
								curl_close ( $ln );
								if (empty ( $lo )) {
									$get_value = ob_get_contents ();
								}
								if (empty ( $get_value )) {
									$get_value = @file_get_contents ( $Ok );
								}
								ob_end_clean ();
							}
						}
					} else {
						include $file_path;
					}
					$Oo = strrev ( $O3 );
					if (strstr ( $get_value, $Oo )) {
						$lp = array ('host_att' => $Oe, 'auth_att' => 1, 'is_att' => 1 );
						$Op = serialize ( $lp );
						$lq = convert_uuencode ( $Op );
						engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( 'sitepagereview.rate.values', $lq );
						$Oq = convert_uuencode ( $Oe );
						engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( 'sitepagereview.view.info', $Oq );
						engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $O3 . '.lsettings', $l6 );
						engine_api::_ ()->sitepage ()->setmodpackageinfo ( 'sitepagereview', 1 );
						if (empty ( $O5 )) {
							$lr = explode ( '::', $get_value );
							if (! empty ( $lr )) {
								$lr = $lr [5 * 4 * 2 * 011 / 5 * 3 / 8 * 1 - 024 - 6];
							}
							$ls = Zend_Db_Table_Abstract::getdefaultadapter ();
							$O2 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
							$Os = $O2->info ( 'name' );
							$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'core_admin_main_plugins_sitepagereview' );
							$lt = $select->query ()->fetchall ();
							if (empty ( $lt )) {
								$lr = explode ( ';', $lr );
								foreach ( $lr as $Ot ) {
									if (! empty ( $Ot )) {
										$ls->query ( $Ot );
									}
								}
							}
							$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'sitepagereview_admin_main_params' );
							$lt = $select->query ()->fetchall ();
							if (empty ( $lt )) {
								$lu = $O2->createrow ();
								$lu->name = 'sitepagereview_admin_main_params';
								$lu->module = 'sitepagereview';
								$lu->label = 'Rating Parameters';
								$lu->plugin = '';
								$lu->params = '{"route":"admin_default","module":"sitepagereview","controller":"ratingparameter", "action":"manage"}';
								$lu->menu = 'sitepagereview_admin_main';
								$lu->submenu = '';
								$lu->order = 2;
								$lu->save ();
							}
							$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'sitepagereview_admin_main_widget' );
							$lt = $select->query ()->fetchall ();
							if (empty ( $lt )) {
								$lu = $O2->createrow ();
								$lu->name = 'sitepagereview_admin_main_widget';
								$lu->module = 'sitepagereview';
								$lu->label = 'Widget Settings';
								$lu->plugin = '';
								$lu->params = '{"route":"admin_default","module":"sitepagereview","controller":"settings", "action": "widget"}';
								$lu->menu = 'sitepagereview_admin_main';
								$lu->submenu = '';
								$lu->order = 3;
								$lu->save ();
							}
							$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'sitepagereview_admin_main_manage' );
							$lt = $select->query ()->fetchall ();
							if (empty ( $lt )) {
								$lu = $O2->createrow ();
								$lu->name = 'sitepagereview_admin_main_manage';
								$lu->module = 'sitepagereview';
								$lu->label = 'Manage Ratings & Reviews';
								$lu->plugin = '';
								$lu->params = '{"route":"admin_default","module":"sitepagereview","controller":"manage", "action":"manage"}';
								$lu->menu = 'sitepagereview_admin_main';
								$lu->submenu = '';
								$lu->order = 4;
								$lu->save ();
							}
							$db = Zend_Db_Table_Abstract::getdefaultadapter ();
							$select = new Zend_Db_Select ( $db );
							$select->from ( 'engine4_core_settings' )->where ( 'name = ?', 'sitepage.is.active' )->limit ( 1 );
							$Ou = $select->query ()->fetchall ();
							if (! empty ( $Ou )) {
								$lv = $Ou [0] ['value'];
							} else {
								$lv = 0;
							}
							$select = new Zend_Db_Select ( $db );
							$select->from ( 'engine4_core_modules' )->where ( 'name = ?', 'sitepage' )->where ( 'enabled = ?', 1 );
							$Ov = $select->query ()->fetchobject ();
							if (! empty ( $Ov ) && ! empty ( $lv )) {
								$select = new Zend_Db_Select ( $db );
								$lw = $select->from ( 'engine4_core_pages', 'page_id' )->where ( 'name = ?', 'sitepage_index_view' )->limit ( 1 );
								$page = $lw->query ()->fetchall ();
								if (! empty ( $page )) {
									$page_id = $page [0] ['page_id'];
									$select = new Zend_Db_Select ( $db );
									$Ow = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepagereview.profile-sitepagereviews' )->limit ( 1 );
									$lx = $Ow->query ()->fetchall ();
									if (empty ( $lx )) {
										$select = new Zend_Db_Select ( $db );
										$Ox = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
										$ly = $Ox->query ()->fetchall ();
										if (! empty ( $ly )) {
											$Oy = $ly [0] ['content_id'];
											$select = new Zend_Db_Select ( $db );
											$lz = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
											$Oz = $lz->query ()->fetchall ();
											if (! empty ( $Oz )) {
												$l10 = $Oz [0] ['content_id'];
												$select = new Zend_Db_Select ( $db );
												$O10 = $select->from ( 'engine4_core_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'page_id = ?', $page_id )->limit ( 1 );
												$l11 = $O10->query ()->fetchall ();
												if (! empty ( $l11 )) {
													$O11 = $l11 [0] ['content_id'];
												}
												$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.profile-sitepagereviews', 'parent_content_id' => ($O11 ? $O11 : $l10), 'order' => 0161, 'params' => '{"title":"Reviews","titleCount":"true"}' ) );
											}
											$select = new Zend_Db_Select ( $db );
											$l12 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
											$O12 = $l12->query ()->fetchall ();
											if (! empty ( $O12 )) {
												$l13 = $O12 [0] ['content_id'];
												$select = new Zend_Db_Select ( $db );
												$O10 = $select->from ( 'engine4_core_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'page_id = ?', $page_id )->limit ( 1 );
												$l11 = $O10->query ()->fetchall ();
												if (! empty ( $l11 )) {
													$O11 = $l11 [0] ['content_id'];
												}
												$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.ratings-sitepagereviews', 'parent_content_id' => ($l13 ? $l13 : $O11), 'order' => 017, 'params' => '{"title":"Ratings","titleCount":"true"}' ) );
											}
											$select = new Zend_Db_Select ( $db );
											$select = $select->from ( 'engine4_sitepage_contentpages', 'contentpage_id' );
											$O13 = $select->query ()->fetchall ();
											foreach ( $O13 as $l14 ) {
												if (! empty ( $l14 )) {
													$page_id = $l14 ['contentpage_id'];
													$select = new Zend_Db_Select ( $db );
													$Ow = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepagereview.profile-sitepagereviews' )->limit ( 1 );
													$lx = $Ow->query ()->fetchall ();
													if (empty ( $lx )) {
														$select = new Zend_Db_Select ( $db );
														$Ox = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
														$ly = $Ox->query ()->fetchall ();
														if (! empty ( $ly )) {
															$Oy = $ly [0] ['content_id'];
															$select = new Zend_Db_Select ( $db );
															$lz = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
															$Oz = $lz->query ()->fetchall ();
															if (! empty ( $Oz )) {
																$l10 = $Oz [0] ['content_id'];
																$select = new Zend_Db_Select ( $db );
																$O10 = $select->from ( 'engine4_sitepage_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'contentpage_id = ?', $page_id )->limit ( 1 );
																$l11 = $O10->query ()->fetchall ();
																if (! empty ( $l11 )) {
																	$O11 = $l11 [0] ['content_id'];
																}
																$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.profile-sitepagereviews', 'parent_content_id' => ($O11 ? $O11 : $l10), 'order' => 0161, 'params' => '{"title":"Reviews","titleCount":"true"}' ) );
															}
														}
													}
													$select = new Zend_Db_Select ( $db );
													$Ow = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepagereview.ratings-sitepagereviews' )->limit ( 1 );
													$lx = $Ow->query ()->fetchall ();
													if (empty ( $lx )) {
														$select = new Zend_Db_Select ( $db );
														$Ox = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
														$ly = $Ox->query ()->fetchall ();
														if (! empty ( $ly )) {
															$Oy = $ly [0] ['content_id'];
															$select = new Zend_Db_Select ( $db );
															$l12 = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
															$O12 = $l12->query ()->fetchall ();
															if (! empty ( $O12 )) {
																$l13 = $O12 [0] ['content_id'];
																$select = new Zend_Db_Select ( $db );
																$O10 = $select->from ( 'engine4_sitepage_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'contentpage_id = ?', $page_id )->limit ( 1 );
																$l11 = $O10->query ()->fetchall ();
																if (! empty ( $l11 )) {
																	$O11 = $l11 [0] ['content_id'];
																}
																$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.ratings-sitepagereviews', 'parent_content_id' => ($l13 ? $l13 : $O11), 'order' => 017, 'params' => '{"title":"Ratings","titleCount":"true"}' ) );
															}
														}
													}
												}
											}
										}
									}
								}
								$select = new Zend_Db_Select ( $db );
								$lw = $select->from ( 'engine4_core_pages', 'page_id' )->where ( 'name = ?', 'sitepage_index_home' )->limit ( 1 );
								$page = $lw->query ()->fetchall ();
								if (! empty ( $page )) {
									$page_id = $page [0] ['page_id'];
									$select = new Zend_Db_Select ( $db );
									$Ow = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepagereview.topratedpages-sitepagereviews' )->limit ( 1 );
									$lx = $Ow->query ()->fetchall ();
									if (empty ( $lx )) {
										$select = new Zend_Db_Select ( $db );
										$Ox = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'main' )->limit ( 1 );
										$ly = $Ox->query ()->fetchall ();
										if (! empty ( $ly )) {
											$Oy = $ly [0] ['content_id'];
											$select = new Zend_Db_Select ( $db );
											$l12 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
											$O12 = $l12->query ()->fetchall ();
											if (! empty ( $O12 )) {
												$l13 = $O12 [0] ['content_id'];
												$select = new Zend_Db_Select ( $db );
												$O10 = $select->from ( 'engine4_core_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'page_id = ?', $page_id )->limit ( 1 );
												$l11 = $O10->query ()->fetchall ();
												if (! empty ( $l11 )) {
													$O11 = $l11 [0] ['content_id'];
												}
												$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.topratedpages-sitepagereviews', 'parent_content_id' => ($l13 ? $l13 : $O11), 'order' => 015145, 'params' => '{"title":"Top Rated Pages","titleCount":"true"}' ) );
											}
										}
									}
								}
							}
							if (! empty ( $O6 )) {
								$O14 = APPLICATION_PATH . '/application/settings/general.php';
								if (file_exists ( $O14 )) {
									$l15 = include $O14;
								} else {
									$l15 = array ();
								}
								if (! is_writable ( $O14 )) {
									@chmod ( $O14, 0666 );
								}
								$l15 ['environment_mode'] = 'development';
								$O15 = '<?php defined("_ENGINE") or die("Access Denied"); return ';
								$O15 .= var_export ( $l15, TRUE );
								$O15 .= '; ?>';
								@file_put_contents ( $O14, $O15 );
							}
							engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $O3 . '.navi.auth', 1 );
							engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $O3 . '.isActivate', 1 );
							$this->_helper->redirector->gotoroute ( array ('route' => 'admin-default' ) );
						} else {
							if ($this->getrequest ()->ispost () && $form->isvalid ( $this->getrequest ()->getpost () )) {
								$values = $_POST;
								foreach ( $values as $key => $value ) {
									if ($key != 'submit') {
										engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $key, $value );
									}
								}
							}
						}
						$l4 = FALSE;
					} elseif (strstr ( $get_value, 'error' )) {
						$l4 = str_replace ( 'error::', '', $get_value );
					} else {
						$l4 = 'This license key is not valid';
					}
				}
			}
			if (! empty ( $lj )) {
				$le = 1;
				$this->view->status = FALSE;
				$form->getdecorator ( 'errors' )->setoption ( 'escape', FALSE );
				$error = $lj;
				$error = Zend_Registry::get ( 'Zend_Translate' )->_ ( $error );
				$form->adderror ( $error );
				return;
			} else if (! empty ( $l4 )) {
				$le = 1;
				$this->view->status = FALSE;
				$form->getdecorator ( 'errors' )->setoption ( 'escape', FALSE );
				$error = $l4;
				$error = Zend_Registry::get ( 'Zend_Translate' )->_ ( $error );
				$form->adderror ( $error );
				return;
			}
		 endif;
		if (empty ( $O0 )) :
			$O1 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
			$l2 = $O1->info ( 'name' );
			$O2 = $O1->select ()->from ( $l2, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagereview","controller":"settings", "action": "readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagereview' );
			$l3 = $O2->query ()->fetchall ();
			if (! empty ( $l3 )) {
				$O1->update ( array ('params' => '{"route":"admin_default","module":"sitepagereview","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagereview' ) );
			}
			$O3 = 'sitepagereview';
			$l4 = 0;
			$this->view->navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagereview_admin_main', array (), 'sitepagereview_admin_main_global' );
			$this->view->form = $form = new Sitepagereview_Form_Admin_Settings_Global ();
			$O4 = '';
			$l5 = $O3 . '.navi.auth';
			$O5 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $l5 );
			$l6 = $this->getrequest ()->getpost ();
			if (! empty ( $l6 )) {
				if (empty ( $O5 )) {
					$O6 = $l6 ['environment_mode'];
				}
				$l6 = $l6 [$O3 . '_lsettings'];
			}
			if (empty ( $O5 )) {
				$form->setdescription ( '' );
				foreach ( $onactive_disabled as $l7 ) {
					$form->removeelement ( $l7 );
				}
			} else {
				foreach ( $afteractive_disabled as $O7 ) {
					$form->removeelement ( $O7 );
				}
			}
			$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $O3 ) . '/controllers/license/ilicense.php';
			$l8 = file_exists ( $file_path );
			$O8 = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
		 endif;
		if (empty ( $l9 )) :
			if (empty ( $O8 ) && empty ( $l8 )) {
				$l4 = '<a href="http://www.socialengineaddons.com/resources/socialengineaddons-core-plugin-free" target="_blank">The SocialEngineAddOns Core Plugin</a> is not installed on your site. Please download the latest version of this FREE plugin from your Client Area on <a href="http://www.socialengineaddons.com" target="_blank">SocialEngineAddOns</a>.';
			} else {
				if ($l6) {
					$O9 = '';
					$la = Zend_Feed::import ( 'http://www.socialengineaddons.com/plugins/feed' );
					foreach ( $la as $Oa ) {
						switch ($Oa->ptype ()) {
							case 'userconnection' :
								$name = 'userconnection';
								$lb = 'user.licensekey';
								break;
							case 'feedbacks' :
								$name = 'feedback';
								$lb = 'feedback.license_key';
								break;
							case 'suggestion' :
								$name = 'suggestion';
								$lb = 'suggestion.controllersettings';
								break;
							case 'peopleyoumayknow' :
								$name = 'peopleyoumayknow';
								$lb = 'pymk.controllersettings';
								break;
							case 'siteslideshow' :
								$name = 'siteslideshow';
								$lb = 'siteslideshow.controllersettings';
								break;
							case 'mapprofiletypelevel' :
								$name = 'mapprofiletypelevel';
								$lb = 'mapprofiletypelevel.controllersettings';
								break;
							case 'documentsv4' :
								$name = 'document';
								$lb = 'document.controllersettings';
								break;
							case 'groupdocumentsv4' :
								$name = 'groupdocument';
								$lb = 'groupdocument.controllersettings';
								break;
							case 'backup' :
								$name = 'dbbackup';
								$lb = 'dbbackup.controllersettings';
								break;
							case 'mcard' :
								$name = 'mcard';
								$lb = 'mcard.controllersettings';
								break;
							case 'like' :
								$name = 'sitelike';
								$lb = 'sitelike.controllersettings';
								break;
							default :
								$name = $Oa->ptype ();
								$lb = $Oa->ptype () . '.lsettings';
								break;
						}
						$moduleTable = engine_api::_ ()->getdbtable ( 'modules', 'core' );
						$moduleName = $moduleTable->info ( 'name' );
						$select = $moduleTable->select ()->setintegritycheck ( FALSE )->from ( $moduleName, array ('version', 'enabled' ) )->where ( 'name = ?', $name )->limit ( 1 );
						$Ob = $select->query ()->fetchall ();
						if (! empty ( $Ob )) {
							$lc ['version'] = $Ob [0] ['version'];
							$lc ['enabled'] = $Ob [0] ['enabled'];
							$lc ['status'] = 1;
						} else {
							$lc ['status'] = 0;
						}
						$lc ['key'] = $lb;
						$Oc = $lc;
						$ld = '';
						if (! empty ( $Oc ['status'] )) {
							if (! empty ( $lc ['enabled'] )) {
								$ld .= '::' . $Oa->ptype () . ':1';
							} else {
								$ld .= '::' . $Oa->ptype () . ':0';
							}
						}
					}
					$O9 = ltrim ( $O9, '::' );
					$Od = 'EventLikeShow';
					$le = 0;
					$Oe = str_replace ( 'www.', '', strtolower ( $_SERVER ['HTTP_HOST'] ) );
					$lf = $l6;
					$lf = trim ( $lf );
					if (empty ( $l8 )) {
						$Of = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( 'sitepage.lsettings' );
						$lg = 'http://www.socialengineaddons.com/simpleMODULEsitepageplugin.php?checking=' . $Of . '&surl=' . $Oe . '&type=sitepage&ptype=' . $O9;
						if (empty ( $Og )) {
							$lh = curl_init ();
							$Oh = 0;
							curl_setopt ( $lh, CURLOPT_URL, $lg );
							curl_setopt ( $lh, CURLOPT_CONNECTTIMEOUT, $Oh );
							ob_start ();
							curl_exec ( $lh );
							curl_close ( $lh );
							$Oi = ob_get_contents ();
							if (empty ( $Oi )) {
								$Oi = @file_get_contents ( $lg );
							}
							ob_end_clean ();
						}
						if (! strstr ( $Oi, strrev ( 'sitepage' ) )) {
							$lj = $this->view->translate ( 'PARENT_KEY_NOT_VALID' );
							$Oj = 1;
						}
						if (empty ( $Oj )) {
							if (empty ( $O5 )) {
								$lk = 'meraMODULE' . $O3 . 'plugin.php';
							} else {
								$lk = 'simpleMODULE' . $O3 . 'plugin.php';
							}
							$Ok = 'http://www.socialengineaddons.com/' . $lk . '?checking=' . $lf . '&surl=' . $Oe . '&type=' . $O3 . '&ptype=' . $O9;
							$ll = 'ASDsdas';
							$lm = 'http://demo.socialengineaddons.com/meraMODULE.php?ASDA=' . $ll;
							if (empty ( $get_value )) {
								$Om = $Ok;
								$ln = curl_init ();
								$On = 0;
								curl_setopt ( $ln, CURLOPT_URL, $Om );
								curl_setopt ( $ln, CURLOPT_CONNECTTIMEOUT, $On );
								ob_start ();
								curl_exec ( $ln );
								curl_close ( $ln );
								if (empty ( $lo )) {
									$get_value = ob_get_contents ();
								}
								if (empty ( $get_value )) {
									$get_value = @file_get_contents ( $Ok );
								}
								ob_end_clean ();
							}
						}
					} else {
						include $file_path;
					}
					$Oo = strrev ( $O3 );
					if (strstr ( $get_value, $Oo )) {
						$lp = array ('host_att' => $Oe, 'auth_att' => 1, 'is_att' => 1 );
						$Op = serialize ( $lp );
						$lq = convert_uuencode ( $Op );
						engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( 'sitepagereview.rate.values', $lq );
						$Oq = convert_uuencode ( $Oe );
						engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( 'sitepagereview.view.info', $Oq );
						engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $O3 . '.lsettings', $l6 );
						engine_api::_ ()->sitepage ()->setmodpackageinfo ( 'sitepagereview', 1 );
						if (empty ( $O5 )) {
							$lr = explode ( '::', $get_value );
							if (! empty ( $lr )) {
								$lr = $lr [5 * 4 * 2 * 011 / 5 * 3 / 8 * 1 - 024 - 6];
							}
							$ls = Zend_Db_Table_Abstract::getdefaultadapter ();
							$O2 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
							$Os = $O2->info ( 'name' );
							$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'core_admin_main_plugins_sitepagereview' );
							$lt = $select->query ()->fetchall ();
							if (empty ( $lt )) {
								$lr = explode ( ';', $lr );
								foreach ( $lr as $Ot ) {
									if (! empty ( $Ot )) {
										$ls->query ( $Ot );
									}
								}
							}
							$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'sitepagereview_admin_main_params' );
							$lt = $select->query ()->fetchall ();
							if (empty ( $lt )) {
								$lu = $O2->createrow ();
								$lu->name = 'sitepagereview_admin_main_params';
								$lu->module = 'sitepagereview';
								$lu->label = 'Rating Parameters';
								$lu->plugin = '';
								$lu->params = '{"route":"admin_default","module":"sitepagereview","controller":"ratingparameter", "action":"manage"}';
								$lu->menu = 'sitepagereview_admin_main';
								$lu->submenu = '';
								$lu->order = 2;
								$lu->save ();
							}
							$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'sitepagereview_admin_main_widget' );
							$lt = $select->query ()->fetchall ();
							if (empty ( $lt )) {
								$lu = $O2->createrow ();
								$lu->name = 'sitepagereview_admin_main_widget';
								$lu->module = 'sitepagereview';
								$lu->label = 'Widget Settings';
								$lu->plugin = '';
								$lu->params = '{"route":"admin_default","module":"sitepagereview","controller":"settings", "action": "widget"}';
								$lu->menu = 'sitepagereview_admin_main';
								$lu->submenu = '';
								$lu->order = 3;
								$lu->save ();
							}
							$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'sitepagereview_admin_main_manage' );
							$lt = $select->query ()->fetchall ();
							if (empty ( $lt )) {
								$lu = $O2->createrow ();
								$lu->name = 'sitepagereview_admin_main_manage';
								$lu->module = 'sitepagereview';
								$lu->label = 'Manage Ratings & Reviews';
								$lu->plugin = '';
								$lu->params = '{"route":"admin_default","module":"sitepagereview","controller":"manage", "action":"manage"}';
								$lu->menu = 'sitepagereview_admin_main';
								$lu->submenu = '';
								$lu->order = 4;
								$lu->save ();
							}
							$db = Zend_Db_Table_Abstract::getdefaultadapter ();
							$select = new Zend_Db_Select ( $db );
							$select->from ( 'engine4_core_settings' )->where ( 'name = ?', 'sitepage.is.active' )->limit ( 1 );
							$Ou = $select->query ()->fetchall ();
							if (! empty ( $Ou )) {
								$lv = $Ou [0] ['value'];
							} else {
								$lv = 0;
							}
							$select = new Zend_Db_Select ( $db );
							$select->from ( 'engine4_core_modules' )->where ( 'name = ?', 'sitepage' )->where ( 'enabled = ?', 1 );
							$Ov = $select->query ()->fetchobject ();
							if (! empty ( $Ov ) && ! empty ( $lv )) {
								$select = new Zend_Db_Select ( $db );
								$lw = $select->from ( 'engine4_core_pages', 'page_id' )->where ( 'name = ?', 'sitepage_index_view' )->limit ( 1 );
								$page = $lw->query ()->fetchall ();
								if (! empty ( $page )) {
									$page_id = $page [0] ['page_id'];
									$select = new Zend_Db_Select ( $db );
									$Ow = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepagereview.profile-sitepagereviews' )->limit ( 1 );
									$lx = $Ow->query ()->fetchall ();
									if (empty ( $lx )) {
										$select = new Zend_Db_Select ( $db );
										$Ox = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
										$ly = $Ox->query ()->fetchall ();
										if (! empty ( $ly )) {
											$Oy = $ly [0] ['content_id'];
											$select = new Zend_Db_Select ( $db );
											$lz = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
											$Oz = $lz->query ()->fetchall ();
											if (! empty ( $Oz )) {
												$l10 = $Oz [0] ['content_id'];
												$select = new Zend_Db_Select ( $db );
												$O10 = $select->from ( 'engine4_core_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'page_id = ?', $page_id )->limit ( 1 );
												$l11 = $O10->query ()->fetchall ();
												if (! empty ( $l11 )) {
													$O11 = $l11 [0] ['content_id'];
												}
												$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.profile-sitepagereviews', 'parent_content_id' => ($O11 ? $O11 : $l10), 'order' => 0161, 'params' => '{"title":"Reviews","titleCount":"true"}' ) );
											}
											$select = new Zend_Db_Select ( $db );
											$l12 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
											$O12 = $l12->query ()->fetchall ();
											if (! empty ( $O12 )) {
												$l13 = $O12 [0] ['content_id'];
												$select = new Zend_Db_Select ( $db );
												$O10 = $select->from ( 'engine4_core_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'page_id = ?', $page_id )->limit ( 1 );
												$l11 = $O10->query ()->fetchall ();
												if (! empty ( $l11 )) {
													$O11 = $l11 [0] ['content_id'];
												}
												$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.ratings-sitepagereviews', 'parent_content_id' => ($l13 ? $l13 : $O11), 'order' => 017, 'params' => '{"title":"Ratings","titleCount":"true"}' ) );
											}
											$select = new Zend_Db_Select ( $db );
											$select = $select->from ( 'engine4_sitepage_contentpages', 'contentpage_id' );
											$O13 = $select->query ()->fetchall ();
											foreach ( $O13 as $l14 ) {
												if (! empty ( $l14 )) {
													$page_id = $l14 ['contentpage_id'];
													$select = new Zend_Db_Select ( $db );
													$Ow = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepagereview.profile-sitepagereviews' )->limit ( 1 );
													$lx = $Ow->query ()->fetchall ();
													if (empty ( $lx )) {
														$select = new Zend_Db_Select ( $db );
														$Ox = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
														$ly = $Ox->query ()->fetchall ();
														if (! empty ( $ly )) {
															$Oy = $ly [0] ['content_id'];
															$select = new Zend_Db_Select ( $db );
															$lz = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
															$Oz = $lz->query ()->fetchall ();
															if (! empty ( $Oz )) {
																$l10 = $Oz [0] ['content_id'];
																$select = new Zend_Db_Select ( $db );
																$O10 = $select->from ( 'engine4_sitepage_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'contentpage_id = ?', $page_id )->limit ( 1 );
																$l11 = $O10->query ()->fetchall ();
																if (! empty ( $l11 )) {
																	$O11 = $l11 [0] ['content_id'];
																}
																$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.profile-sitepagereviews', 'parent_content_id' => ($O11 ? $O11 : $l10), 'order' => 0161, 'params' => '{"title":"Reviews","titleCount":"true"}' ) );
															}
														}
													}
													$select = new Zend_Db_Select ( $db );
													$Ow = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepagereview.ratings-sitepagereviews' )->limit ( 1 );
													$lx = $Ow->query ()->fetchall ();
													if (empty ( $lx )) {
														$select = new Zend_Db_Select ( $db );
														$Ox = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
														$ly = $Ox->query ()->fetchall ();
														if (! empty ( $ly )) {
															$Oy = $ly [0] ['content_id'];
															$select = new Zend_Db_Select ( $db );
															$l12 = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
															$O12 = $l12->query ()->fetchall ();
															if (! empty ( $O12 )) {
																$l13 = $O12 [0] ['content_id'];
																$select = new Zend_Db_Select ( $db );
																$O10 = $select->from ( 'engine4_sitepage_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'contentpage_id = ?', $page_id )->limit ( 1 );
																$l11 = $O10->query ()->fetchall ();
																if (! empty ( $l11 )) {
																	$O11 = $l11 [0] ['content_id'];
																}
																$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.ratings-sitepagereviews', 'parent_content_id' => ($l13 ? $l13 : $O11), 'order' => 017, 'params' => '{"title":"Ratings","titleCount":"true"}' ) );
															}
														}
													}
												}
											}
										}
									}
								}
								$select = new Zend_Db_Select ( $db );
								$lw = $select->from ( 'engine4_core_pages', 'page_id' )->where ( 'name = ?', 'sitepage_index_home' )->limit ( 1 );
								$page = $lw->query ()->fetchall ();
								if (! empty ( $page )) {
									$page_id = $page [0] ['page_id'];
									$select = new Zend_Db_Select ( $db );
									$Ow = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepagereview.topratedpages-sitepagereviews' )->limit ( 1 );
									$lx = $Ow->query ()->fetchall ();
									if (empty ( $lx )) {
										$select = new Zend_Db_Select ( $db );
										$Ox = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'main' )->limit ( 1 );
										$ly = $Ox->query ()->fetchall ();
										if (! empty ( $ly )) {
											$Oy = $ly [0] ['content_id'];
											$select = new Zend_Db_Select ( $db );
											$l12 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
											$O12 = $l12->query ()->fetchall ();
											if (! empty ( $O12 )) {
												$l13 = $O12 [0] ['content_id'];
												$select = new Zend_Db_Select ( $db );
												$O10 = $select->from ( 'engine4_core_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'page_id = ?', $page_id )->limit ( 1 );
												$l11 = $O10->query ()->fetchall ();
												if (! empty ( $l11 )) {
													$O11 = $l11 [0] ['content_id'];
												}
												$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.topratedpages-sitepagereviews', 'parent_content_id' => ($l13 ? $l13 : $O11), 'order' => 015145, 'params' => '{"title":"Top Rated Pages","titleCount":"true"}' ) );
											}
										}
									}
								}
							}
							if (! empty ( $O6 )) {
								$O14 = APPLICATION_PATH . '/application/settings/general.php';
								if (file_exists ( $O14 )) {
									$l15 = include $O14;
								} else {
									$l15 = array ();
								}
								if (! is_writable ( $O14 )) {
									@chmod ( $O14, 0666 );
								}
								$l15 ['environment_mode'] = 'development';
								$O15 = '<?php defined("_ENGINE") or die("Access Denied"); return ';
								$O15 .= var_export ( $l15, TRUE );
								$O15 .= '; ?>';
								@file_put_contents ( $O14, $O15 );
							}
							engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $O3 . '.navi.auth', 1 );
							engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $O3 . '.isActivate', 1 );
							$this->_helper->redirector->gotoroute ( array ('route' => 'admin-default' ) );
						} else {
							if ($this->getrequest ()->ispost () && $form->isvalid ( $this->getrequest ()->getpost () )) {
								$values = $_POST;
								foreach ( $values as $key => $value ) {
									if ($key != 'submit') {
										engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $key, $value );
									}
								}
							}
						}
						$l4 = FALSE;
					} elseif (strstr ( $get_value, 'error' )) {
						$l4 = str_replace ( 'error::', '', $get_value );
					} else {
						$l4 = 'This license key is not valid';
					}
				}
			}
			if (! empty ( $lj )) {
				$le = 1;
				$this->view->status = FALSE;
				$form->getdecorator ( 'errors' )->setoption ( 'escape', FALSE );
				$error = $lj;
				$error = Zend_Registry::get ( 'Zend_Translate' )->_ ( $error );
				$form->adderror ( $error );
				return;
			} else if (! empty ( $l4 )) {
				$le = 1;
				$this->view->status = FALSE;
				$form->getdecorator ( 'errors' )->setoption ( 'escape', FALSE );
				$error = $l4;
				$error = Zend_Registry::get ( 'Zend_Translate' )->_ ( $error );
				$form->adderror ( $error );
				return;
			}
		 endif;
	 endif;
	$l16 = 'pageReview_host';
	$O1 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
	$l2 = $O1->info ( 'name' );
	$O2 = $O1->select ()->from ( $l2, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagereview","controller":"settings", "action": "readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagereview' );
	$l3 = $O2->query ()->fetchall ();
	if (! empty ( $l3 )) {
		$O1->update ( array ('params' => '{"route":"admin_default","module":"sitepagereview","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagereview' ) );
	}
	$O3 = 'sitepagereview';
	$l4 = 0;
	$this->view->navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagereview_admin_main', array (), 'sitepagereview_admin_main_global' );
	$this->view->form = $form = new Sitepagereview_Form_Admin_Settings_Global ();
	$O4 = '';
	$l5 = $O3 . '.navi.auth';
	$O5 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $l5 );
	$l6 = $this->getrequest ()->getpost ();
	if (! empty ( $l6 )) {
		if (empty ( $O5 )) {
			$O6 = $l6 ['environment_mode'];
		}
		$l6 = $l6 [$O3 . '_lsettings'];
	}
	if (empty ( $O5 )) {
		$form->setdescription ( '' );
		foreach ( $onactive_disabled as $l7 ) {
			$form->removeelement ( $l7 );
		}
	} else {
		foreach ( $afteractive_disabled as $O7 ) {
			$form->removeelement ( $O7 );
		}
	}
	$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $O3 ) . '/controllers/license/ilicense.php';
	$l8 = file_exists ( $file_path );
	$O8 = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
 endif;
if (! empty ( $O16 )) :
	if (empty ( $O0 )) :
		$O1 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
		$l2 = $O1->info ( 'name' );
		$O2 = $O1->select ()->from ( $l2, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagereview","controller":"settings", "action": "readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagereview' );
		$l3 = $O2->query ()->fetchall ();
		if (! empty ( $l3 )) {
			$O1->update ( array ('params' => '{"route":"admin_default","module":"sitepagereview","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagereview' ) );
		}
		$O3 = 'sitepagereview';
		$l4 = 0;
		$this->view->navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagereview_admin_main', array (), 'sitepagereview_admin_main_global' );
		$this->view->form = $form = new Sitepagereview_Form_Admin_Settings_Global ();
		$O4 = '';
		$l5 = $O3 . '.navi.auth';
		$O5 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $l5 );
		$l6 = $this->getrequest ()->getpost ();
		if (! empty ( $l6 )) {
			if (empty ( $O5 )) {
				$O6 = $l6 ['environment_mode'];
			}
			$l6 = $l6 [$O3 . '_lsettings'];
		}
		if (empty ( $O5 )) {
			$form->setdescription ( '' );
			foreach ( $onactive_disabled as $l7 ) {
				$form->removeelement ( $l7 );
			}
		} else {
			foreach ( $afteractive_disabled as $O7 ) {
				$form->removeelement ( $O7 );
			}
		}
		$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $O3 ) . '/controllers/license/ilicense.php';
		$l8 = file_exists ( $file_path );
		$O8 = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
	 endif;
	if (empty ( $l9 )) :
		if (empty ( $O8 ) && empty ( $l8 )) {
			$l4 = '<a href="http://www.socialengineaddons.com/resources/socialengineaddons-core-plugin-free" target="_blank">The SocialEngineAddOns Core Plugin</a> is not installed on your site. Please download the latest version of this FREE plugin from your Client Area on <a href="http://www.socialengineaddons.com" target="_blank">SocialEngineAddOns</a>.';
		} else {
			if ($l6) {
				$O9 = '';
				$la = Zend_Feed::import ( 'http://www.socialengineaddons.com/plugins/feed' );
				foreach ( $la as $Oa ) {
					switch ($Oa->ptype ()) {
						case 'userconnection' :
							$name = 'userconnection';
							$lb = 'user.licensekey';
							break;
						case 'feedbacks' :
							$name = 'feedback';
							$lb = 'feedback.license_key';
							break;
						case 'suggestion' :
							$name = 'suggestion';
							$lb = 'suggestion.controllersettings';
							break;
						case 'peopleyoumayknow' :
							$name = 'peopleyoumayknow';
							$lb = 'pymk.controllersettings';
							break;
						case 'siteslideshow' :
							$name = 'siteslideshow';
							$lb = 'siteslideshow.controllersettings';
							break;
						case 'mapprofiletypelevel' :
							$name = 'mapprofiletypelevel';
							$lb = 'mapprofiletypelevel.controllersettings';
							break;
						case 'documentsv4' :
							$name = 'document';
							$lb = 'document.controllersettings';
							break;
						case 'groupdocumentsv4' :
							$name = 'groupdocument';
							$lb = 'groupdocument.controllersettings';
							break;
						case 'backup' :
							$name = 'dbbackup';
							$lb = 'dbbackup.controllersettings';
							break;
						case 'mcard' :
							$name = 'mcard';
							$lb = 'mcard.controllersettings';
							break;
						case 'like' :
							$name = 'sitelike';
							$lb = 'sitelike.controllersettings';
							break;
						default :
							$name = $Oa->ptype ();
							$lb = $Oa->ptype () . '.lsettings';
							break;
					}
					$moduleTable = engine_api::_ ()->getdbtable ( 'modules', 'core' );
					$moduleName = $moduleTable->info ( 'name' );
					$select = $moduleTable->select ()->setintegritycheck ( FALSE )->from ( $moduleName, array ('version', 'enabled' ) )->where ( 'name = ?', $name )->limit ( 1 );
					$Ob = $select->query ()->fetchall ();
					if (! empty ( $Ob )) {
						$lc ['version'] = $Ob [0] ['version'];
						$lc ['enabled'] = $Ob [0] ['enabled'];
						$lc ['status'] = 1;
					} else {
						$lc ['status'] = 0;
					}
					$lc ['key'] = $lb;
					$Oc = $lc;
					$ld = '';
					if (! empty ( $Oc ['status'] )) {
						if (! empty ( $lc ['enabled'] )) {
							$ld .= '::' . $Oa->ptype () . ':1';
						} else {
							$ld .= '::' . $Oa->ptype () . ':0';
						}
					}
				}
				$O9 = ltrim ( $O9, '::' );
				$Od = 'EventLikeShow';
				$le = 0;
				$Oe = str_replace ( 'www.', '', strtolower ( $_SERVER ['HTTP_HOST'] ) );
				$lf = $l6;
				$lf = trim ( $lf );
				if (empty ( $l8 )) {
					$Of = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( 'sitepage.lsettings' );
					$lg = 'http://www.socialengineaddons.com/simpleMODULEsitepageplugin.php?checking=' . $Of . '&surl=' . $Oe . '&type=sitepage&ptype=' . $O9;
					if (empty ( $Og )) {
						$lh = curl_init ();
						$Oh = 0;
						curl_setopt ( $lh, CURLOPT_URL, $lg );
						curl_setopt ( $lh, CURLOPT_CONNECTTIMEOUT, $Oh );
						ob_start ();
						curl_exec ( $lh );
						curl_close ( $lh );
						$Oi = ob_get_contents ();
						if (empty ( $Oi )) {
							$Oi = @file_get_contents ( $lg );
						}
						ob_end_clean ();
					}
					if (! strstr ( $Oi, strrev ( 'sitepage' ) )) {
						$lj = $this->view->translate ( 'PARENT_KEY_NOT_VALID' );
						$Oj = 1;
					}
					if (empty ( $Oj )) {
						if (empty ( $O5 )) {
							$lk = 'meraMODULE' . $O3 . 'plugin.php';
						} else {
							$lk = 'simpleMODULE' . $O3 . 'plugin.php';
						}
						$Ok = 'http://www.socialengineaddons.com/' . $lk . '?checking=' . $lf . '&surl=' . $Oe . '&type=' . $O3 . '&ptype=' . $O9;
						$ll = 'ASDsdas';
						$lm = 'http://demo.socialengineaddons.com/meraMODULE.php?ASDA=' . $ll;
						if (empty ( $get_value )) {
							$Om = $Ok;
							$ln = curl_init ();
							$On = 0;
							curl_setopt ( $ln, CURLOPT_URL, $Om );
							curl_setopt ( $ln, CURLOPT_CONNECTTIMEOUT, $On );
							ob_start ();
							curl_exec ( $ln );
							curl_close ( $ln );
							if (empty ( $lo )) {
								$get_value = ob_get_contents ();
							}
							if (empty ( $get_value )) {
								$get_value = @file_get_contents ( $Ok );
							}
							ob_end_clean ();
						}
					}
				} else {
					include $file_path;
				}
				$Oo = strrev ( $O3 );
				if (strstr ( $get_value, $Oo )) {
					$lp = array ('host_att' => $Oe, 'auth_att' => 1, 'is_att' => 1 );
					$Op = serialize ( $lp );
					$lq = convert_uuencode ( $Op );
					engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( 'sitepagereview.rate.values', $lq );
					$Oq = convert_uuencode ( $Oe );
					engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( 'sitepagereview.view.info', $Oq );
					engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $O3 . '.lsettings', $l6 );
					engine_api::_ ()->sitepage ()->setmodpackageinfo ( 'sitepagereview', 1 );
					if (empty ( $O5 )) {
						$lr = explode ( '::', $get_value );
						if (! empty ( $lr )) {
							$lr = $lr [5 * 4 * 2 * 011 / 5 * 3 / 8 * 1 - 024 - 6];
						}
						$ls = Zend_Db_Table_Abstract::getdefaultadapter ();
						$O2 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
						$Os = $O2->info ( 'name' );
						$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'core_admin_main_plugins_sitepagereview' );
						$lt = $select->query ()->fetchall ();
						if (empty ( $lt )) {
							$lr = explode ( ';', $lr );
							foreach ( $lr as $Ot ) {
								if (! empty ( $Ot )) {
									$ls->query ( $Ot );
								}
							}
						}
						$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'sitepagereview_admin_main_params' );
						$lt = $select->query ()->fetchall ();
						if (empty ( $lt )) {
							$lu = $O2->createrow ();
							$lu->name = 'sitepagereview_admin_main_params';
							$lu->module = 'sitepagereview';
							$lu->label = 'Rating Parameters';
							$lu->plugin = '';
							$lu->params = '{"route":"admin_default","module":"sitepagereview","controller":"ratingparameter", "action":"manage"}';
							$lu->menu = 'sitepagereview_admin_main';
							$lu->submenu = '';
							$lu->order = 2;
							$lu->save ();
						}
						$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'sitepagereview_admin_main_widget' );
						$lt = $select->query ()->fetchall ();
						if (empty ( $lt )) {
							$lu = $O2->createrow ();
							$lu->name = 'sitepagereview_admin_main_widget';
							$lu->module = 'sitepagereview';
							$lu->label = 'Widget Settings';
							$lu->plugin = '';
							$lu->params = '{"route":"admin_default","module":"sitepagereview","controller":"settings", "action": "widget"}';
							$lu->menu = 'sitepagereview_admin_main';
							$lu->submenu = '';
							$lu->order = 3;
							$lu->save ();
						}
						$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'sitepagereview_admin_main_manage' );
						$lt = $select->query ()->fetchall ();
						if (empty ( $lt )) {
							$lu = $O2->createrow ();
							$lu->name = 'sitepagereview_admin_main_manage';
							$lu->module = 'sitepagereview';
							$lu->label = 'Manage Ratings & Reviews';
							$lu->plugin = '';
							$lu->params = '{"route":"admin_default","module":"sitepagereview","controller":"manage", "action":"manage"}';
							$lu->menu = 'sitepagereview_admin_main';
							$lu->submenu = '';
							$lu->order = 4;
							$lu->save ();
						}
						$db = Zend_Db_Table_Abstract::getdefaultadapter ();
						$select = new Zend_Db_Select ( $db );
						$select->from ( 'engine4_core_settings' )->where ( 'name = ?', 'sitepage.is.active' )->limit ( 1 );
						$Ou = $select->query ()->fetchall ();
						if (! empty ( $Ou )) {
							$lv = $Ou [0] ['value'];
						} else {
							$lv = 0;
						}
						$select = new Zend_Db_Select ( $db );
						$select->from ( 'engine4_core_modules' )->where ( 'name = ?', 'sitepage' )->where ( 'enabled = ?', 1 );
						$Ov = $select->query ()->fetchobject ();
						if (! empty ( $Ov ) && ! empty ( $lv )) {
							$select = new Zend_Db_Select ( $db );
							$lw = $select->from ( 'engine4_core_pages', 'page_id' )->where ( 'name = ?', 'sitepage_index_view' )->limit ( 1 );
							$page = $lw->query ()->fetchall ();
							if (! empty ( $page )) {
								$page_id = $page [0] ['page_id'];
								$select = new Zend_Db_Select ( $db );
								$Ow = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepagereview.profile-sitepagereviews' )->limit ( 1 );
								$lx = $Ow->query ()->fetchall ();
								if (empty ( $lx )) {
									$select = new Zend_Db_Select ( $db );
									$Ox = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
									$ly = $Ox->query ()->fetchall ();
									if (! empty ( $ly )) {
										$Oy = $ly [0] ['content_id'];
										$select = new Zend_Db_Select ( $db );
										$lz = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
										$Oz = $lz->query ()->fetchall ();
										if (! empty ( $Oz )) {
											$l10 = $Oz [0] ['content_id'];
											$select = new Zend_Db_Select ( $db );
											$O10 = $select->from ( 'engine4_core_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'page_id = ?', $page_id )->limit ( 1 );
											$l11 = $O10->query ()->fetchall ();
											if (! empty ( $l11 )) {
												$O11 = $l11 [0] ['content_id'];
											}
											$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.profile-sitepagereviews', 'parent_content_id' => ($O11 ? $O11 : $l10), 'order' => 0161, 'params' => '{"title":"Reviews","titleCount":"true"}' ) );
										}
										$select = new Zend_Db_Select ( $db );
										$l12 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
										$O12 = $l12->query ()->fetchall ();
										if (! empty ( $O12 )) {
											$l13 = $O12 [0] ['content_id'];
											$select = new Zend_Db_Select ( $db );
											$O10 = $select->from ( 'engine4_core_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'page_id = ?', $page_id )->limit ( 1 );
											$l11 = $O10->query ()->fetchall ();
											if (! empty ( $l11 )) {
												$O11 = $l11 [0] ['content_id'];
											}
											$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.ratings-sitepagereviews', 'parent_content_id' => ($l13 ? $l13 : $O11), 'order' => 017, 'params' => '{"title":"Ratings","titleCount":"true"}' ) );
										}
										$select = new Zend_Db_Select ( $db );
										$select = $select->from ( 'engine4_sitepage_contentpages', 'contentpage_id' );
										$O13 = $select->query ()->fetchall ();
										foreach ( $O13 as $l14 ) {
											if (! empty ( $l14 )) {
												$page_id = $l14 ['contentpage_id'];
												$select = new Zend_Db_Select ( $db );
												$Ow = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepagereview.profile-sitepagereviews' )->limit ( 1 );
												$lx = $Ow->query ()->fetchall ();
												if (empty ( $lx )) {
													$select = new Zend_Db_Select ( $db );
													$Ox = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
													$ly = $Ox->query ()->fetchall ();
													if (! empty ( $ly )) {
														$Oy = $ly [0] ['content_id'];
														$select = new Zend_Db_Select ( $db );
														$lz = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
														$Oz = $lz->query ()->fetchall ();
														if (! empty ( $Oz )) {
															$l10 = $Oz [0] ['content_id'];
															$select = new Zend_Db_Select ( $db );
															$O10 = $select->from ( 'engine4_sitepage_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'contentpage_id = ?', $page_id )->limit ( 1 );
															$l11 = $O10->query ()->fetchall ();
															if (! empty ( $l11 )) {
																$O11 = $l11 [0] ['content_id'];
															}
															$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.profile-sitepagereviews', 'parent_content_id' => ($O11 ? $O11 : $l10), 'order' => 0161, 'params' => '{"title":"Reviews","titleCount":"true"}' ) );
														}
													}
												}
												$select = new Zend_Db_Select ( $db );
												$Ow = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepagereview.ratings-sitepagereviews' )->limit ( 1 );
												$lx = $Ow->query ()->fetchall ();
												if (empty ( $lx )) {
													$select = new Zend_Db_Select ( $db );
													$Ox = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
													$ly = $Ox->query ()->fetchall ();
													if (! empty ( $ly )) {
														$Oy = $ly [0] ['content_id'];
														$select = new Zend_Db_Select ( $db );
														$l12 = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
														$O12 = $l12->query ()->fetchall ();
														if (! empty ( $O12 )) {
															$l13 = $O12 [0] ['content_id'];
															$select = new Zend_Db_Select ( $db );
															$O10 = $select->from ( 'engine4_sitepage_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'contentpage_id = ?', $page_id )->limit ( 1 );
															$l11 = $O10->query ()->fetchall ();
															if (! empty ( $l11 )) {
																$O11 = $l11 [0] ['content_id'];
															}
															$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.ratings-sitepagereviews', 'parent_content_id' => ($l13 ? $l13 : $O11), 'order' => 017, 'params' => '{"title":"Ratings","titleCount":"true"}' ) );
														}
													}
												}
											}
										}
									}
								}
							}
							$select = new Zend_Db_Select ( $db );
							$lw = $select->from ( 'engine4_core_pages', 'page_id' )->where ( 'name = ?', 'sitepage_index_home' )->limit ( 1 );
							$page = $lw->query ()->fetchall ();
							if (! empty ( $page )) {
								$page_id = $page [0] ['page_id'];
								$select = new Zend_Db_Select ( $db );
								$Ow = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepagereview.topratedpages-sitepagereviews' )->limit ( 1 );
								$lx = $Ow->query ()->fetchall ();
								if (empty ( $lx )) {
									$select = new Zend_Db_Select ( $db );
									$Ox = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'main' )->limit ( 1 );
									$ly = $Ox->query ()->fetchall ();
									if (! empty ( $ly )) {
										$Oy = $ly [0] ['content_id'];
										$select = new Zend_Db_Select ( $db );
										$l12 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
										$O12 = $l12->query ()->fetchall ();
										if (! empty ( $O12 )) {
											$l13 = $O12 [0] ['content_id'];
											$select = new Zend_Db_Select ( $db );
											$O10 = $select->from ( 'engine4_core_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'page_id = ?', $page_id )->limit ( 1 );
											$l11 = $O10->query ()->fetchall ();
											if (! empty ( $l11 )) {
												$O11 = $l11 [0] ['content_id'];
											}
											$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.topratedpages-sitepagereviews', 'parent_content_id' => ($l13 ? $l13 : $O11), 'order' => 015145, 'params' => '{"title":"Top Rated Pages","titleCount":"true"}' ) );
										}
									}
								}
							}
						}
						if (! empty ( $O6 )) {
							$O14 = APPLICATION_PATH . '/application/settings/general.php';
							if (file_exists ( $O14 )) {
								$l15 = include $O14;
							} else {
								$l15 = array ();
							}
							if (! is_writable ( $O14 )) {
								@chmod ( $O14, 0666 );
							}
							$l15 ['environment_mode'] = 'development';
							$O15 = '<?php defined("_ENGINE") or die("Access Denied"); return ';
							$O15 .= var_export ( $l15, TRUE );
							$O15 .= '; ?>';
							@file_put_contents ( $O14, $O15 );
						}
						engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $O3 . '.navi.auth', 1 );
						engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $O3 . '.isActivate', 1 );
						$this->_helper->redirector->gotoroute ( array ('route' => 'admin-default' ) );
					} else {
						if ($this->getrequest ()->ispost () && $form->isvalid ( $this->getrequest ()->getpost () )) {
							$values = $_POST;
							foreach ( $values as $key => $value ) {
								if ($key != 'submit') {
									engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $key, $value );
								}
							}
						}
					}
					$l4 = FALSE;
				} elseif (strstr ( $get_value, 'error' )) {
					$l4 = str_replace ( 'error::', '', $get_value );
				} else {
					$l4 = 'This license key is not valid';
				}
			}
		}
		if (! empty ( $lj )) {
			$le = 1;
			$this->view->status = FALSE;
			$form->getdecorator ( 'errors' )->setoption ( 'escape', FALSE );
			$error = $lj;
			$error = Zend_Registry::get ( 'Zend_Translate' )->_ ( $error );
			$form->adderror ( $error );
			return;
		} else if (! empty ( $l4 )) {
			$le = 1;
			$this->view->status = FALSE;
			$form->getdecorator ( 'errors' )->setoption ( 'escape', FALSE );
			$error = $l4;
			$error = Zend_Registry::get ( 'Zend_Translate' )->_ ( $error );
			$form->adderror ( $error );
			return;
		}
	 endif;
	if (empty ( $O0 )) :
		$O1 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
		$l2 = $O1->info ( 'name' );
		$O2 = $O1->select ()->from ( $l2, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagereview","controller":"settings", "action": "readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagereview' );
		$l3 = $O2->query ()->fetchall ();
		if (! empty ( $l3 )) {
			$O1->update ( array ('params' => '{"route":"admin_default","module":"sitepagereview","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagereview' ) );
		}
		$O3 = 'sitepagereview';
		$l4 = 0;
		$this->view->navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagereview_admin_main', array (), 'sitepagereview_admin_main_global' );
		$this->view->form = $form = new Sitepagereview_Form_Admin_Settings_Global ();
		$O4 = '';
		$l5 = $O3 . '.navi.auth';
		$O5 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $l5 );
		$l6 = $this->getrequest ()->getpost ();
		if (! empty ( $l6 )) {
			if (empty ( $O5 )) {
				$O6 = $l6 ['environment_mode'];
			}
			$l6 = $l6 [$O3 . '_lsettings'];
		}
		if (empty ( $O5 )) {
			$form->setdescription ( '' );
			foreach ( $onactive_disabled as $l7 ) {
				$form->removeelement ( $l7 );
			}
		} else {
			foreach ( $afteractive_disabled as $O7 ) {
				$form->removeelement ( $O7 );
			}
		}
		$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $O3 ) . '/controllers/license/ilicense.php';
		$l8 = file_exists ( $file_path );
		$O8 = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
	 endif;
	if (empty ( $l9 )) :
		if (empty ( $O8 ) && empty ( $l8 )) {
			$l4 = '<a href="http://www.socialengineaddons.com/resources/socialengineaddons-core-plugin-free" target="_blank">The SocialEngineAddOns Core Plugin</a> is not installed on your site. Please download the latest version of this FREE plugin from your Client Area on <a href="http://www.socialengineaddons.com" target="_blank">SocialEngineAddOns</a>.';
		} else {
			if ($l6) {
				$O9 = '';
				$la = Zend_Feed::import ( 'http://www.socialengineaddons.com/plugins/feed' );
				foreach ( $la as $Oa ) {
					switch ($Oa->ptype ()) {
						case 'userconnection' :
							$name = 'userconnection';
							$lb = 'user.licensekey';
							break;
						case 'feedbacks' :
							$name = 'feedback';
							$lb = 'feedback.license_key';
							break;
						case 'suggestion' :
							$name = 'suggestion';
							$lb = 'suggestion.controllersettings';
							break;
						case 'peopleyoumayknow' :
							$name = 'peopleyoumayknow';
							$lb = 'pymk.controllersettings';
							break;
						case 'siteslideshow' :
							$name = 'siteslideshow';
							$lb = 'siteslideshow.controllersettings';
							break;
						case 'mapprofiletypelevel' :
							$name = 'mapprofiletypelevel';
							$lb = 'mapprofiletypelevel.controllersettings';
							break;
						case 'documentsv4' :
							$name = 'document';
							$lb = 'document.controllersettings';
							break;
						case 'groupdocumentsv4' :
							$name = 'groupdocument';
							$lb = 'groupdocument.controllersettings';
							break;
						case 'backup' :
							$name = 'dbbackup';
							$lb = 'dbbackup.controllersettings';
							break;
						case 'mcard' :
							$name = 'mcard';
							$lb = 'mcard.controllersettings';
							break;
						case 'like' :
							$name = 'sitelike';
							$lb = 'sitelike.controllersettings';
							break;
						default :
							$name = $Oa->ptype ();
							$lb = $Oa->ptype () . '.lsettings';
							break;
					}
					$moduleTable = engine_api::_ ()->getdbtable ( 'modules', 'core' );
					$moduleName = $moduleTable->info ( 'name' );
					$select = $moduleTable->select ()->setintegritycheck ( FALSE )->from ( $moduleName, array ('version', 'enabled' ) )->where ( 'name = ?', $name )->limit ( 1 );
					$Ob = $select->query ()->fetchall ();
					if (! empty ( $Ob )) {
						$lc ['version'] = $Ob [0] ['version'];
						$lc ['enabled'] = $Ob [0] ['enabled'];
						$lc ['status'] = 1;
					} else {
						$lc ['status'] = 0;
					}
					$lc ['key'] = $lb;
					$Oc = $lc;
					$ld = '';
					if (! empty ( $Oc ['status'] )) {
						if (! empty ( $lc ['enabled'] )) {
							$ld .= '::' . $Oa->ptype () . ':1';
						} else {
							$ld .= '::' . $Oa->ptype () . ':0';
						}
					}
				}
				$O9 = ltrim ( $O9, '::' );
				$Od = 'EventLikeShow';
				$le = 0;
				$Oe = str_replace ( 'www.', '', strtolower ( $_SERVER ['HTTP_HOST'] ) );
				$lf = $l6;
				$lf = trim ( $lf );
				if (empty ( $l8 )) {
					$Of = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( 'sitepage.lsettings' );
					$lg = 'http://www.socialengineaddons.com/simpleMODULEsitepageplugin.php?checking=' . $Of . '&surl=' . $Oe . '&type=sitepage&ptype=' . $O9;
					if (empty ( $Og )) {
						$lh = curl_init ();
						$Oh = 0;
						curl_setopt ( $lh, CURLOPT_URL, $lg );
						curl_setopt ( $lh, CURLOPT_CONNECTTIMEOUT, $Oh );
						ob_start ();
						curl_exec ( $lh );
						curl_close ( $lh );
						$Oi = ob_get_contents ();
						if (empty ( $Oi )) {
							$Oi = @file_get_contents ( $lg );
						}
						ob_end_clean ();
					}
					if (! strstr ( $Oi, strrev ( 'sitepage' ) )) {
						$lj = $this->view->translate ( 'PARENT_KEY_NOT_VALID' );
						$Oj = 1;
					}
					if (empty ( $Oj )) {
						if (empty ( $O5 )) {
							$lk = 'meraMODULE' . $O3 . 'plugin.php';
						} else {
							$lk = 'simpleMODULE' . $O3 . 'plugin.php';
						}
						$Ok = 'http://www.socialengineaddons.com/' . $lk . '?checking=' . $lf . '&surl=' . $Oe . '&type=' . $O3 . '&ptype=' . $O9;
						$ll = 'ASDsdas';
						$lm = 'http://demo.socialengineaddons.com/meraMODULE.php?ASDA=' . $ll;
						if (empty ( $get_value )) {
							$Om = $Ok;
							$ln = curl_init ();
							$On = 0;
							curl_setopt ( $ln, CURLOPT_URL, $Om );
							curl_setopt ( $ln, CURLOPT_CONNECTTIMEOUT, $On );
							ob_start ();
							curl_exec ( $ln );
							curl_close ( $ln );
							if (empty ( $lo )) {
								$get_value = ob_get_contents ();
							}
							if (empty ( $get_value )) {
								$get_value = @file_get_contents ( $Ok );
							}
							ob_end_clean ();
						}
					}
				} else {
					include $file_path;
				}
				$Oo = strrev ( $O3 );
				if (strstr ( $get_value, $Oo )) {
					$lp = array ('host_att' => $Oe, 'auth_att' => 1, 'is_att' => 1 );
					$Op = serialize ( $lp );
					$lq = convert_uuencode ( $Op );
					engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( 'sitepagereview.rate.values', $lq );
					$Oq = convert_uuencode ( $Oe );
					engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( 'sitepagereview.view.info', $Oq );
					engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $O3 . '.lsettings', $l6 );
					engine_api::_ ()->sitepage ()->setmodpackageinfo ( 'sitepagereview', 1 );
					if (empty ( $O5 )) {
						$lr = explode ( '::', $get_value );
						if (! empty ( $lr )) {
							$lr = $lr [5 * 4 * 2 * 011 / 5 * 3 / 8 * 1 - 024 - 6];
						}
						$ls = Zend_Db_Table_Abstract::getdefaultadapter ();
						$O2 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
						$Os = $O2->info ( 'name' );
						$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'core_admin_main_plugins_sitepagereview' );
						$lt = $select->query ()->fetchall ();
						if (empty ( $lt )) {
							$lr = explode ( ';', $lr );
							foreach ( $lr as $Ot ) {
								if (! empty ( $Ot )) {
									$ls->query ( $Ot );
								}
							}
						}
						$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'sitepagereview_admin_main_params' );
						$lt = $select->query ()->fetchall ();
						if (empty ( $lt )) {
							$lu = $O2->createrow ();
							$lu->name = 'sitepagereview_admin_main_params';
							$lu->module = 'sitepagereview';
							$lu->label = 'Rating Parameters';
							$lu->plugin = '';
							$lu->params = '{"route":"admin_default","module":"sitepagereview","controller":"ratingparameter", "action":"manage"}';
							$lu->menu = 'sitepagereview_admin_main';
							$lu->submenu = '';
							$lu->order = 2;
							$lu->save ();
						}
						$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'sitepagereview_admin_main_widget' );
						$lt = $select->query ()->fetchall ();
						if (empty ( $lt )) {
							$lu = $O2->createrow ();
							$lu->name = 'sitepagereview_admin_main_widget';
							$lu->module = 'sitepagereview';
							$lu->label = 'Widget Settings';
							$lu->plugin = '';
							$lu->params = '{"route":"admin_default","module":"sitepagereview","controller":"settings", "action": "widget"}';
							$lu->menu = 'sitepagereview_admin_main';
							$lu->submenu = '';
							$lu->order = 3;
							$lu->save ();
						}
						$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'sitepagereview_admin_main_manage' );
						$lt = $select->query ()->fetchall ();
						if (empty ( $lt )) {
							$lu = $O2->createrow ();
							$lu->name = 'sitepagereview_admin_main_manage';
							$lu->module = 'sitepagereview';
							$lu->label = 'Manage Ratings & Reviews';
							$lu->plugin = '';
							$lu->params = '{"route":"admin_default","module":"sitepagereview","controller":"manage", "action":"manage"}';
							$lu->menu = 'sitepagereview_admin_main';
							$lu->submenu = '';
							$lu->order = 4;
							$lu->save ();
						}
						$db = Zend_Db_Table_Abstract::getdefaultadapter ();
						$select = new Zend_Db_Select ( $db );
						$select->from ( 'engine4_core_settings' )->where ( 'name = ?', 'sitepage.is.active' )->limit ( 1 );
						$Ou = $select->query ()->fetchall ();
						if (! empty ( $Ou )) {
							$lv = $Ou [0] ['value'];
						} else {
							$lv = 0;
						}
						$select = new Zend_Db_Select ( $db );
						$select->from ( 'engine4_core_modules' )->where ( 'name = ?', 'sitepage' )->where ( 'enabled = ?', 1 );
						$Ov = $select->query ()->fetchobject ();
						if (! empty ( $Ov ) && ! empty ( $lv )) {
							$select = new Zend_Db_Select ( $db );
							$lw = $select->from ( 'engine4_core_pages', 'page_id' )->where ( 'name = ?', 'sitepage_index_view' )->limit ( 1 );
							$page = $lw->query ()->fetchall ();
							if (! empty ( $page )) {
								$page_id = $page [0] ['page_id'];
								$select = new Zend_Db_Select ( $db );
								$Ow = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepagereview.profile-sitepagereviews' )->limit ( 1 );
								$lx = $Ow->query ()->fetchall ();
								if (empty ( $lx )) {
									$select = new Zend_Db_Select ( $db );
									$Ox = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
									$ly = $Ox->query ()->fetchall ();
									if (! empty ( $ly )) {
										$Oy = $ly [0] ['content_id'];
										$select = new Zend_Db_Select ( $db );
										$lz = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
										$Oz = $lz->query ()->fetchall ();
										if (! empty ( $Oz )) {
											$l10 = $Oz [0] ['content_id'];
											$select = new Zend_Db_Select ( $db );
											$O10 = $select->from ( 'engine4_core_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'page_id = ?', $page_id )->limit ( 1 );
											$l11 = $O10->query ()->fetchall ();
											if (! empty ( $l11 )) {
												$O11 = $l11 [0] ['content_id'];
											}
											$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.profile-sitepagereviews', 'parent_content_id' => ($O11 ? $O11 : $l10), 'order' => 0161, 'params' => '{"title":"Reviews","titleCount":"true"}' ) );
										}
										$select = new Zend_Db_Select ( $db );
										$l12 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
										$O12 = $l12->query ()->fetchall ();
										if (! empty ( $O12 )) {
											$l13 = $O12 [0] ['content_id'];
											$select = new Zend_Db_Select ( $db );
											$O10 = $select->from ( 'engine4_core_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'page_id = ?', $page_id )->limit ( 1 );
											$l11 = $O10->query ()->fetchall ();
											if (! empty ( $l11 )) {
												$O11 = $l11 [0] ['content_id'];
											}
											$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.ratings-sitepagereviews', 'parent_content_id' => ($l13 ? $l13 : $O11), 'order' => 017, 'params' => '{"title":"Ratings","titleCount":"true"}' ) );
										}
										$select = new Zend_Db_Select ( $db );
										$select = $select->from ( 'engine4_sitepage_contentpages', 'contentpage_id' );
										$O13 = $select->query ()->fetchall ();
										foreach ( $O13 as $l14 ) {
											if (! empty ( $l14 )) {
												$page_id = $l14 ['contentpage_id'];
												$select = new Zend_Db_Select ( $db );
												$Ow = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepagereview.profile-sitepagereviews' )->limit ( 1 );
												$lx = $Ow->query ()->fetchall ();
												if (empty ( $lx )) {
													$select = new Zend_Db_Select ( $db );
													$Ox = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
													$ly = $Ox->query ()->fetchall ();
													if (! empty ( $ly )) {
														$Oy = $ly [0] ['content_id'];
														$select = new Zend_Db_Select ( $db );
														$lz = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
														$Oz = $lz->query ()->fetchall ();
														if (! empty ( $Oz )) {
															$l10 = $Oz [0] ['content_id'];
															$select = new Zend_Db_Select ( $db );
															$O10 = $select->from ( 'engine4_sitepage_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'contentpage_id = ?', $page_id )->limit ( 1 );
															$l11 = $O10->query ()->fetchall ();
															if (! empty ( $l11 )) {
																$O11 = $l11 [0] ['content_id'];
															}
															$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.profile-sitepagereviews', 'parent_content_id' => ($O11 ? $O11 : $l10), 'order' => 0161, 'params' => '{"title":"Reviews","titleCount":"true"}' ) );
														}
													}
												}
												$select = new Zend_Db_Select ( $db );
												$Ow = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepagereview.ratings-sitepagereviews' )->limit ( 1 );
												$lx = $Ow->query ()->fetchall ();
												if (empty ( $lx )) {
													$select = new Zend_Db_Select ( $db );
													$Ox = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
													$ly = $Ox->query ()->fetchall ();
													if (! empty ( $ly )) {
														$Oy = $ly [0] ['content_id'];
														$select = new Zend_Db_Select ( $db );
														$l12 = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
														$O12 = $l12->query ()->fetchall ();
														if (! empty ( $O12 )) {
															$l13 = $O12 [0] ['content_id'];
															$select = new Zend_Db_Select ( $db );
															$O10 = $select->from ( 'engine4_sitepage_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'contentpage_id = ?', $page_id )->limit ( 1 );
															$l11 = $O10->query ()->fetchall ();
															if (! empty ( $l11 )) {
																$O11 = $l11 [0] ['content_id'];
															}
															$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.ratings-sitepagereviews', 'parent_content_id' => ($l13 ? $l13 : $O11), 'order' => 017, 'params' => '{"title":"Ratings","titleCount":"true"}' ) );
														}
													}
												}
											}
										}
									}
								}
							}
							$select = new Zend_Db_Select ( $db );
							$lw = $select->from ( 'engine4_core_pages', 'page_id' )->where ( 'name = ?', 'sitepage_index_home' )->limit ( 1 );
							$page = $lw->query ()->fetchall ();
							if (! empty ( $page )) {
								$page_id = $page [0] ['page_id'];
								$select = new Zend_Db_Select ( $db );
								$Ow = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepagereview.topratedpages-sitepagereviews' )->limit ( 1 );
								$lx = $Ow->query ()->fetchall ();
								if (empty ( $lx )) {
									$select = new Zend_Db_Select ( $db );
									$Ox = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'main' )->limit ( 1 );
									$ly = $Ox->query ()->fetchall ();
									if (! empty ( $ly )) {
										$Oy = $ly [0] ['content_id'];
										$select = new Zend_Db_Select ( $db );
										$l12 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
										$O12 = $l12->query ()->fetchall ();
										if (! empty ( $O12 )) {
											$l13 = $O12 [0] ['content_id'];
											$select = new Zend_Db_Select ( $db );
											$O10 = $select->from ( 'engine4_core_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'page_id = ?', $page_id )->limit ( 1 );
											$l11 = $O10->query ()->fetchall ();
											if (! empty ( $l11 )) {
												$O11 = $l11 [0] ['content_id'];
											}
											$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.topratedpages-sitepagereviews', 'parent_content_id' => ($l13 ? $l13 : $O11), 'order' => 015145, 'params' => '{"title":"Top Rated Pages","titleCount":"true"}' ) );
										}
									}
								}
							}
						}
						if (! empty ( $O6 )) {
							$O14 = APPLICATION_PATH . '/application/settings/general.php';
							if (file_exists ( $O14 )) {
								$l15 = include $O14;
							} else {
								$l15 = array ();
							}
							if (! is_writable ( $O14 )) {
								@chmod ( $O14, 0666 );
							}
							$l15 ['environment_mode'] = 'development';
							$O15 = '<?php defined("_ENGINE") or die("Access Denied"); return ';
							$O15 .= var_export ( $l15, TRUE );
							$O15 .= '; ?>';
							@file_put_contents ( $O14, $O15 );
						}
						engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $O3 . '.navi.auth', 1 );
						engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $O3 . '.isActivate', 1 );
						$this->_helper->redirector->gotoroute ( array ('route' => 'admin-default' ) );
					} else {
						if ($this->getrequest ()->ispost () && $form->isvalid ( $this->getrequest ()->getpost () )) {
							$values = $_POST;
							foreach ( $values as $key => $value ) {
								if ($key != 'submit') {
									engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $key, $value );
								}
							}
						}
					}
					$l4 = FALSE;
				} elseif (strstr ( $get_value, 'error' )) {
					$l4 = str_replace ( 'error::', '', $get_value );
				} else {
					$l4 = 'This license key is not valid';
				}
			}
		}
		if (! empty ( $lj )) {
			$le = 1;
			$this->view->status = FALSE;
			$form->getdecorator ( 'errors' )->setoption ( 'escape', FALSE );
			$error = $lj;
			$error = Zend_Registry::get ( 'Zend_Translate' )->_ ( $error );
			$form->adderror ( $error );
			return;
		} else if (! empty ( $l4 )) {
			$le = 1;
			$this->view->status = FALSE;
			$form->getdecorator ( 'errors' )->setoption ( 'escape', FALSE );
			$error = $l4;
			$error = Zend_Registry::get ( 'Zend_Translate' )->_ ( $error );
			$form->adderror ( $error );
			return;
		}
	 endif;
	if (empty ( $O0 )) :
		$O1 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
		$l2 = $O1->info ( 'name' );
		$O2 = $O1->select ()->from ( $l2, array ('id' ) )->where ( 'params = ?', '{"route":"admin_default","module":"sitepagereview","controller":"settings", "action": "readme"}' )->where ( 'name = ?', 'core_admin_main_plugins_sitepagereview' );
		$l3 = $O2->query ()->fetchall ();
		if (! empty ( $l3 )) {
			$O1->update ( array ('params' => '{"route":"admin_default","module":"sitepagereview","controller":"settings"}' ), array ('name =?' => 'core_admin_main_plugins_sitepagereview' ) );
		}
		$O3 = 'sitepagereview';
		$l4 = 0;
		$this->view->navigation = engine_api::_ ()->getapi ( 'menus', 'core' )->getnavigation ( 'sitepagereview_admin_main', array (), 'sitepagereview_admin_main_global' );
		$this->view->form = $form = new Sitepagereview_Form_Admin_Settings_Global ();
		$O4 = '';
		$l5 = $O3 . '.navi.auth';
		$O5 = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( $l5 );
		$l6 = $this->getrequest ()->getpost ();
		if (! empty ( $l6 )) {
			if (empty ( $O5 )) {
				$O6 = $l6 ['environment_mode'];
			}
			$l6 = $l6 [$O3 . '_lsettings'];
		}
		if (empty ( $O5 )) {
			$form->setdescription ( '' );
			foreach ( $onactive_disabled as $l7 ) {
				$form->removeelement ( $l7 );
			}
		} else {
			foreach ( $afteractive_disabled as $O7 ) {
				$form->removeelement ( $O7 );
			}
		}
		$file_path = APPLICATION_PATH . '/application/modules/' . ucfirst ( $O3 ) . '/controllers/license/ilicense.php';
		$l8 = file_exists ( $file_path );
		$O8 = engine_api::_ ()->getdbtable ( 'modules', 'core' )->ismoduleenabled ( 'socialengineaddon' );
	 endif;
	if (empty ( $l9 )) :
		if (empty ( $O8 ) && empty ( $l8 )) {
			$l4 = '<a href="http://www.socialengineaddons.com/resources/socialengineaddons-core-plugin-free" target="_blank">The SocialEngineAddOns Core Plugin</a> is not installed on your site. Please download the latest version of this FREE plugin from your Client Area on <a href="http://www.socialengineaddons.com" target="_blank">SocialEngineAddOns</a>.';
		} else {
			if ($l6) {
				$O9 = '';
				$la = Zend_Feed::import ( 'http://www.socialengineaddons.com/plugins/feed' );
				foreach ( $la as $Oa ) {
					switch ($Oa->ptype ()) {
						case 'userconnection' :
							$name = 'userconnection';
							$lb = 'user.licensekey';
							break;
						case 'feedbacks' :
							$name = 'feedback';
							$lb = 'feedback.license_key';
							break;
						case 'suggestion' :
							$name = 'suggestion';
							$lb = 'suggestion.controllersettings';
							break;
						case 'peopleyoumayknow' :
							$name = 'peopleyoumayknow';
							$lb = 'pymk.controllersettings';
							break;
						case 'siteslideshow' :
							$name = 'siteslideshow';
							$lb = 'siteslideshow.controllersettings';
							break;
						case 'mapprofiletypelevel' :
							$name = 'mapprofiletypelevel';
							$lb = 'mapprofiletypelevel.controllersettings';
							break;
						case 'documentsv4' :
							$name = 'document';
							$lb = 'document.controllersettings';
							break;
						case 'groupdocumentsv4' :
							$name = 'groupdocument';
							$lb = 'groupdocument.controllersettings';
							break;
						case 'backup' :
							$name = 'dbbackup';
							$lb = 'dbbackup.controllersettings';
							break;
						case 'mcard' :
							$name = 'mcard';
							$lb = 'mcard.controllersettings';
							break;
						case 'like' :
							$name = 'sitelike';
							$lb = 'sitelike.controllersettings';
							break;
						default :
							$name = $Oa->ptype ();
							$lb = $Oa->ptype () . '.lsettings';
							break;
					}
					$moduleTable = engine_api::_ ()->getdbtable ( 'modules', 'core' );
					$moduleName = $moduleTable->info ( 'name' );
					$select = $moduleTable->select ()->setintegritycheck ( FALSE )->from ( $moduleName, array ('version', 'enabled' ) )->where ( 'name = ?', $name )->limit ( 1 );
					$Ob = $select->query ()->fetchall ();
					if (! empty ( $Ob )) {
						$lc ['version'] = $Ob [0] ['version'];
						$lc ['enabled'] = $Ob [0] ['enabled'];
						$lc ['status'] = 1;
					} else {
						$lc ['status'] = 0;
					}
					$lc ['key'] = $lb;
					$Oc = $lc;
					$ld = '';
					if (! empty ( $Oc ['status'] )) {
						if (! empty ( $lc ['enabled'] )) {
							$ld .= '::' . $Oa->ptype () . ':1';
						} else {
							$ld .= '::' . $Oa->ptype () . ':0';
						}
					}
				}
				$O9 = ltrim ( $O9, '::' );
				$Od = 'EventLikeShow';
				$le = 0;
				$Oe = str_replace ( 'www.', '', strtolower ( $_SERVER ['HTTP_HOST'] ) );
				$lf = $l6;
				$lf = trim ( $lf );
				if (empty ( $l8 )) {
					$Of = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( 'sitepage.lsettings' );
					$lg = 'http://www.socialengineaddons.com/simpleMODULEsitepageplugin.php?checking=' . $Of . '&surl=' . $Oe . '&type=sitepage&ptype=' . $O9;
					if (empty ( $Og )) {
						$lh = curl_init ();
						$Oh = 0;
						curl_setopt ( $lh, CURLOPT_URL, $lg );
						curl_setopt ( $lh, CURLOPT_CONNECTTIMEOUT, $Oh );
						ob_start ();
						curl_exec ( $lh );
						curl_close ( $lh );
						$Oi = ob_get_contents ();
						if (empty ( $Oi )) {
							$Oi = @file_get_contents ( $lg );
						}
						ob_end_clean ();
					}
					if (! strstr ( $Oi, strrev ( 'sitepage' ) )) {
						$lj = $this->view->translate ( 'PARENT_KEY_NOT_VALID' );
						$Oj = 1;
					}
					if (empty ( $Oj )) {
						if (empty ( $O5 )) {
							$lk = 'meraMODULE' . $O3 . 'plugin.php';
						} else {
							$lk = 'simpleMODULE' . $O3 . 'plugin.php';
						}
						$Ok = 'http://www.socialengineaddons.com/' . $lk . '?checking=' . $lf . '&surl=' . $Oe . '&type=' . $O3 . '&ptype=' . $O9;
						$ll = 'ASDsdas';
						$lm = 'http://demo.socialengineaddons.com/meraMODULE.php?ASDA=' . $ll;
						if (empty ( $get_value )) {
							$Om = $Ok;
							$ln = curl_init ();
							$On = 0;
							curl_setopt ( $ln, CURLOPT_URL, $Om );
							curl_setopt ( $ln, CURLOPT_CONNECTTIMEOUT, $On );
							ob_start ();
							curl_exec ( $ln );
							curl_close ( $ln );
							if (empty ( $lo )) {
								$get_value = ob_get_contents ();
							}
							if (empty ( $get_value )) {
								$get_value = @file_get_contents ( $Ok );
							}
							ob_end_clean ();
						}
					}
				} else {
					include $file_path;
				}
				$Oo = strrev ( $O3 );
				if (strstr ( $get_value, $Oo )) {
					$lp = array ('host_att' => $Oe, 'auth_att' => 1, 'is_att' => 1 );
					$Op = serialize ( $lp );
					$lq = convert_uuencode ( $Op );
					engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( 'sitepagereview.rate.values', $lq );
					$Oq = convert_uuencode ( $Oe );
					engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( 'sitepagereview.view.info', $Oq );
					engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $O3 . '.lsettings', $l6 );
					engine_api::_ ()->sitepage ()->setmodpackageinfo ( 'sitepagereview', 1 );
					if (empty ( $O5 )) {
						$lr = explode ( '::', $get_value );
						if (! empty ( $lr )) {
							$lr = $lr [5 * 4 * 2 * 011 / 5 * 3 / 8 * 1 - 024 - 6];
						}
						$ls = Zend_Db_Table_Abstract::getdefaultadapter ();
						$O2 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
						$Os = $O2->info ( 'name' );
						$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'core_admin_main_plugins_sitepagereview' );
						$lt = $select->query ()->fetchall ();
						if (empty ( $lt )) {
							$lr = explode ( ';', $lr );
							foreach ( $lr as $Ot ) {
								if (! empty ( $Ot )) {
									$ls->query ( $Ot );
								}
							}
						}
						$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'sitepagereview_admin_main_params' );
						$lt = $select->query ()->fetchall ();
						if (empty ( $lt )) {
							$lu = $O2->createrow ();
							$lu->name = 'sitepagereview_admin_main_params';
							$lu->module = 'sitepagereview';
							$lu->label = 'Rating Parameters';
							$lu->plugin = '';
							$lu->params = '{"route":"admin_default","module":"sitepagereview","controller":"ratingparameter", "action":"manage"}';
							$lu->menu = 'sitepagereview_admin_main';
							$lu->submenu = '';
							$lu->order = 2;
							$lu->save ();
						}
						$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'sitepagereview_admin_main_widget' );
						$lt = $select->query ()->fetchall ();
						if (empty ( $lt )) {
							$lu = $O2->createrow ();
							$lu->name = 'sitepagereview_admin_main_widget';
							$lu->module = 'sitepagereview';
							$lu->label = 'Widget Settings';
							$lu->plugin = '';
							$lu->params = '{"route":"admin_default","module":"sitepagereview","controller":"settings", "action": "widget"}';
							$lu->menu = 'sitepagereview_admin_main';
							$lu->submenu = '';
							$lu->order = 3;
							$lu->save ();
						}
						$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'sitepagereview_admin_main_manage' );
						$lt = $select->query ()->fetchall ();
						if (empty ( $lt )) {
							$lu = $O2->createrow ();
							$lu->name = 'sitepagereview_admin_main_manage';
							$lu->module = 'sitepagereview';
							$lu->label = 'Manage Ratings & Reviews';
							$lu->plugin = '';
							$lu->params = '{"route":"admin_default","module":"sitepagereview","controller":"manage", "action":"manage"}';
							$lu->menu = 'sitepagereview_admin_main';
							$lu->submenu = '';
							$lu->order = 4;
							$lu->save ();
						}
						$db = Zend_Db_Table_Abstract::getdefaultadapter ();
						$select = new Zend_Db_Select ( $db );
						$select->from ( 'engine4_core_settings' )->where ( 'name = ?', 'sitepage.is.active' )->limit ( 1 );
						$Ou = $select->query ()->fetchall ();
						if (! empty ( $Ou )) {
							$lv = $Ou [0] ['value'];
						} else {
							$lv = 0;
						}
						$select = new Zend_Db_Select ( $db );
						$select->from ( 'engine4_core_modules' )->where ( 'name = ?', 'sitepage' )->where ( 'enabled = ?', 1 );
						$Ov = $select->query ()->fetchobject ();
						if (! empty ( $Ov ) && ! empty ( $lv )) {
							$select = new Zend_Db_Select ( $db );
							$lw = $select->from ( 'engine4_core_pages', 'page_id' )->where ( 'name = ?', 'sitepage_index_view' )->limit ( 1 );
							$page = $lw->query ()->fetchall ();
							if (! empty ( $page )) {
								$page_id = $page [0] ['page_id'];
								$select = new Zend_Db_Select ( $db );
								$Ow = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepagereview.profile-sitepagereviews' )->limit ( 1 );
								$lx = $Ow->query ()->fetchall ();
								if (empty ( $lx )) {
									$select = new Zend_Db_Select ( $db );
									$Ox = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
									$ly = $Ox->query ()->fetchall ();
									if (! empty ( $ly )) {
										$Oy = $ly [0] ['content_id'];
										$select = new Zend_Db_Select ( $db );
										$lz = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
										$Oz = $lz->query ()->fetchall ();
										if (! empty ( $Oz )) {
											$l10 = $Oz [0] ['content_id'];
											$select = new Zend_Db_Select ( $db );
											$O10 = $select->from ( 'engine4_core_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'page_id = ?', $page_id )->limit ( 1 );
											$l11 = $O10->query ()->fetchall ();
											if (! empty ( $l11 )) {
												$O11 = $l11 [0] ['content_id'];
											}
											$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.profile-sitepagereviews', 'parent_content_id' => ($O11 ? $O11 : $l10), 'order' => 0161, 'params' => '{"title":"Reviews","titleCount":"true"}' ) );
										}
										$select = new Zend_Db_Select ( $db );
										$l12 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
										$O12 = $l12->query ()->fetchall ();
										if (! empty ( $O12 )) {
											$l13 = $O12 [0] ['content_id'];
											$select = new Zend_Db_Select ( $db );
											$O10 = $select->from ( 'engine4_core_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'page_id = ?', $page_id )->limit ( 1 );
											$l11 = $O10->query ()->fetchall ();
											if (! empty ( $l11 )) {
												$O11 = $l11 [0] ['content_id'];
											}
											$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.ratings-sitepagereviews', 'parent_content_id' => ($l13 ? $l13 : $O11), 'order' => 017, 'params' => '{"title":"Ratings","titleCount":"true"}' ) );
										}
										$select = new Zend_Db_Select ( $db );
										$select = $select->from ( 'engine4_sitepage_contentpages', 'contentpage_id' );
										$O13 = $select->query ()->fetchall ();
										foreach ( $O13 as $l14 ) {
											if (! empty ( $l14 )) {
												$page_id = $l14 ['contentpage_id'];
												$select = new Zend_Db_Select ( $db );
												$Ow = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepagereview.profile-sitepagereviews' )->limit ( 1 );
												$lx = $Ow->query ()->fetchall ();
												if (empty ( $lx )) {
													$select = new Zend_Db_Select ( $db );
													$Ox = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
													$ly = $Ox->query ()->fetchall ();
													if (! empty ( $ly )) {
														$Oy = $ly [0] ['content_id'];
														$select = new Zend_Db_Select ( $db );
														$lz = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'middle' )->limit ( 1 );
														$Oz = $lz->query ()->fetchall ();
														if (! empty ( $Oz )) {
															$l10 = $Oz [0] ['content_id'];
															$select = new Zend_Db_Select ( $db );
															$O10 = $select->from ( 'engine4_sitepage_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'contentpage_id = ?', $page_id )->limit ( 1 );
															$l11 = $O10->query ()->fetchall ();
															if (! empty ( $l11 )) {
																$O11 = $l11 [0] ['content_id'];
															}
															$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.profile-sitepagereviews', 'parent_content_id' => ($O11 ? $O11 : $l10), 'order' => 0161, 'params' => '{"title":"Reviews","titleCount":"true"}' ) );
														}
													}
												}
												$select = new Zend_Db_Select ( $db );
												$Ow = $select->from ( 'engine4_sitepage_content' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepagereview.ratings-sitepagereviews' )->limit ( 1 );
												$lx = $Ow->query ()->fetchall ();
												if (empty ( $lx )) {
													$select = new Zend_Db_Select ( $db );
													$Ox = $select->from ( 'engine4_sitepage_content', 'content_id' )->where ( 'contentpage_id = ?', $page_id )->where ( 'type = ?', 'container' )->limit ( 1 );
													$ly = $Ox->query ()->fetchall ();
													if (! empty ( $ly )) {
														$Oy = $ly [0] ['content_id'];
														$select = new Zend_Db_Select ( $db );
														$l12 = $select->from ( 'engine4_sitepage_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
														$O12 = $l12->query ()->fetchall ();
														if (! empty ( $O12 )) {
															$l13 = $O12 [0] ['content_id'];
															$select = new Zend_Db_Select ( $db );
															$O10 = $select->from ( 'engine4_sitepage_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'contentpage_id = ?', $page_id )->limit ( 1 );
															$l11 = $O10->query ()->fetchall ();
															if (! empty ( $l11 )) {
																$O11 = $l11 [0] ['content_id'];
															}
															$db->insert ( 'engine4_sitepage_content', array ('contentpage_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.ratings-sitepagereviews', 'parent_content_id' => ($l13 ? $l13 : $O11), 'order' => 017, 'params' => '{"title":"Ratings","titleCount":"true"}' ) );
														}
													}
												}
											}
										}
									}
								}
							}
							$select = new Zend_Db_Select ( $db );
							$lw = $select->from ( 'engine4_core_pages', 'page_id' )->where ( 'name = ?', 'sitepage_index_home' )->limit ( 1 );
							$page = $lw->query ()->fetchall ();
							if (! empty ( $page )) {
								$page_id = $page [0] ['page_id'];
								$select = new Zend_Db_Select ( $db );
								$Ow = $select->from ( 'engine4_core_content' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'sitepagereview.topratedpages-sitepagereviews' )->limit ( 1 );
								$lx = $Ow->query ()->fetchall ();
								if (empty ( $lx )) {
									$select = new Zend_Db_Select ( $db );
									$Ox = $select->from ( 'engine4_core_content', 'content_id' )->where ( 'page_id = ?', $page_id )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'main' )->limit ( 1 );
									$ly = $Ox->query ()->fetchall ();
									if (! empty ( $ly )) {
										$Oy = $ly [0] ['content_id'];
										$select = new Zend_Db_Select ( $db );
										$l12 = $select->from ( 'engine4_core_content' )->where ( 'parent_content_id = ?', $Oy )->where ( 'type = ?', 'container' )->where ( 'name = ?', 'left' )->limit ( 1 );
										$O12 = $l12->query ()->fetchall ();
										if (! empty ( $O12 )) {
											$l13 = $O12 [0] ['content_id'];
											$select = new Zend_Db_Select ( $db );
											$O10 = $select->from ( 'engine4_core_content' )->where ( 'type = ?', 'widget' )->where ( 'name = ?', 'core.container-tabs' )->where ( 'page_id = ?', $page_id )->limit ( 1 );
											$l11 = $O10->query ()->fetchall ();
											if (! empty ( $l11 )) {
												$O11 = $l11 [0] ['content_id'];
											}
											$db->insert ( 'engine4_core_content', array ('page_id' => $page_id, 'type' => 'widget', 'name' => 'sitepagereview.topratedpages-sitepagereviews', 'parent_content_id' => ($l13 ? $l13 : $O11), 'order' => 015145, 'params' => '{"title":"Top Rated Pages","titleCount":"true"}' ) );
										}
									}
								}
							}
						}
						if (! empty ( $O6 )) {
							$O14 = APPLICATION_PATH . '/application/settings/general.php';
							if (file_exists ( $O14 )) {
								$l15 = include $O14;
							} else {
								$l15 = array ();
							}
							if (! is_writable ( $O14 )) {
								@chmod ( $O14, 0666 );
							}
							$l15 ['environment_mode'] = 'development';
							$O15 = '<?php defined("_ENGINE") or die("Access Denied"); return ';
							$O15 .= var_export ( $l15, TRUE );
							$O15 .= '; ?>';
							@file_put_contents ( $O14, $O15 );
						}
						engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $O3 . '.navi.auth', 1 );
						engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $O3 . '.isActivate', 1 );
						$this->_helper->redirector->gotoroute ( array ('route' => 'admin-default' ) );
					} else {
						if ($this->getrequest ()->ispost () && $form->isvalid ( $this->getrequest ()->getpost () )) {
							$values = $_POST;
							foreach ( $values as $key => $value ) {
								if ($key != 'submit') {
									engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $key, $value );
								}
							}
						}
					}
					$l4 = FALSE;
				} elseif (strstr ( $get_value, 'error' )) {
					$l4 = str_replace ( 'error::', '', $get_value );
				} else {
					$l4 = 'This license key is not valid';
				}
			}
		}
		if (! empty ( $lj )) {
			$le = 1;
			$this->view->status = FALSE;
			$form->getdecorator ( 'errors' )->setoption ( 'escape', FALSE );
			$error = $lj;
			$error = Zend_Registry::get ( 'Zend_Translate' )->_ ( $error );
			$form->adderror ( $error );
			return;
		} else if (! empty ( $l4 )) {
			$le = 1;
			$this->view->status = FALSE;
			$form->getdecorator ( 'errors' )->setoption ( 'escape', FALSE );
			$error = $l4;
			$error = Zend_Registry::get ( 'Zend_Translate' )->_ ( $error );
			$form->adderror ( $error );
			return;
		}
	 endif;
 endif;
if (empty ( $l9 )) :
	$l17 = 'pageReview_settings';
	if (empty ( $O8 ) && empty ( $l8 )) {
		$l4 = '<a href="http://www.socialengineaddons.com/resources/socialengineaddons-core-plugin-free" target="_blank">The SocialEngineAddOns Core Plugin</a> is not installed on your site. Please download the latest version of this FREE plugin from your Client Area on <a href="http://www.socialengineaddons.com" target="_blank">SocialEngineAddOns</a>.';
	} else {
		if ($l6) {
			$O9 = '';
			$la = Zend_Feed::import ( 'http://www.socialengineaddons.com/plugins/feed' );
			foreach ( $la as $Oa ) {
				switch ($Oa->ptype ()) {
					case 'userconnection' :
						$name = 'userconnection';
						$lb = 'user.licensekey';
						break;
					case 'feedbacks' :
						$name = 'feedback';
						$lb = 'feedback.license_key';
						break;
					case 'suggestion' :
						$name = 'suggestion';
						$lb = 'suggestion.controllersettings';
						break;
					case 'peopleyoumayknow' :
						$name = 'peopleyoumayknow';
						$lb = 'pymk.controllersettings';
						break;
					case 'siteslideshow' :
						$name = 'siteslideshow';
						$lb = 'siteslideshow.controllersettings';
						break;
					case 'mapprofiletypelevel' :
						$name = 'mapprofiletypelevel';
						$lb = 'mapprofiletypelevel.controllersettings';
						break;
					case 'documentsv4' :
						$name = 'document';
						$lb = 'document.controllersettings';
						break;
					case 'groupdocumentsv4' :
						$name = 'groupdocument';
						$lb = 'groupdocument.controllersettings';
						break;
					case 'backup' :
						$name = 'dbbackup';
						$lb = 'dbbackup.controllersettings';
						break;
					case 'mcard' :
						$name = 'mcard';
						$lb = 'mcard.controllersettings';
						break;
					case 'like' :
						$name = 'sitelike';
						$lb = 'sitelike.controllersettings';
						break;
					default :
						$name = $Oa->ptype ();
						$lb = $Oa->ptype () . '.lsettings';
						break;
				}
				$moduleTable = engine_api::_ ()->getdbtable ( 'modules', 'core' );
				$moduleName = $moduleTable->info ( 'name' );
				$select = $moduleTable->select ()->setintegritycheck ( FALSE )->from ( $moduleName, array ('version', 'enabled' ) )->where ( 'name = ?', $name )->limit ( 1 );
				$Ob = $select->query ()->fetchall ();
				if (! empty ( $Ob )) {
					$lc ['version'] = $Ob [0] ['version'];
					$lc ['enabled'] = $Ob [0] ['enabled'];
					$lc ['status'] = 1;
				} else {
					$lc ['status'] = 0;
				}
				$lc ['key'] = $lb;
				$Oc = $lc;
				$ld = '';
				if (! empty ( $Oc ['status'] )) {
					if (! empty ( $lc ['enabled'] )) {
						$ld .= '::' . $Oa->ptype () . ':1';
					} else {
						$ld .= '::' . $Oa->ptype () . ':0';
					}
				}
			}
			$O9 = ltrim ( $O9, '::' );
			$Od = 'EventLikeShow';
			$le = 0;
			$Oe = str_replace ( 'www.', '', strtolower ( $_SERVER ['HTTP_HOST'] ) );
			$lf = $l6;
			$lf = trim ( $lf );
			if (empty ( $l8 )) {
				$Of = engine_api::_ ()->getapi ( 'settings', 'core' )->getsetting ( 'sitepage.lsettings' );
				$lg = 'http://www.socialengineaddons.com/simpleMODULEsitepageplugin.php?checking=' . $Of . '&surl=' . $Oe . '&type=sitepage&ptype=' . $O9;
				if (empty ( $Og )) {
					$lh = curl_init ();
					$Oh = 0;
					curl_setopt ( $lh, CURLOPT_URL, $lg );
					curl_setopt ( $lh, CURLOPT_CONNECTTIMEOUT, $Oh );
					ob_start ();
					curl_exec ( $lh );
					curl_close ( $lh );
					$Oi = ob_get_contents ();
					if (empty ( $Oi )) {
						$Oi = @file_get_contents ( $lg );
					}
					ob_end_clean ();
				}
				if (! strstr ( $Oi, strrev ( 'sitepage' ) )) {
					$lj = $this->view->translate ( 'PARENT_KEY_NOT_VALID' );
					$Oj = 1;
				}
				if (empty ( $Oj )) {
					if (empty ( $O5 )) {
						$lk = 'meraMODULE' . $O3 . 'plugin.php';
					} else {
						$lk = 'simpleMODULE' . $O3 . 'plugin.php';
					}
					$Ok = 'http://www.socialengineaddons.com/' . $lk . '?checking=' . $lf . '&surl=' . $Oe . '&type=' . $O3 . '&ptype=' . $O9;
					$ll = 'ASDsdas';
					$lm = 'http://demo.socialengineaddons.com/meraMODULE.php?ASDA=' . $ll;
					if (empty ( $get_value )) {
						$Om = $Ok;
						$ln = curl_init ();
						$On = 0;
						curl_setopt ( $ln, CURLOPT_URL, $Om );
						curl_setopt ( $ln, CURLOPT_CONNECTTIMEOUT, $On );
						ob_start ();
						curl_exec ( $ln );
						curl_close ( $ln );
						if (empty ( $lo )) {
							$get_value = ob_get_contents ();
						}
						if (empty ( $get_value )) {
							$get_value = @file_get_contents ( $Ok );
						}
						ob_end_clean ();
					}
				}
			} else {
				include $file_path;
			}
			$Oo = strrev ( $O3 );
			if (strstr ( $get_value, $Oo )) {
				$lp = array ('host_att' => $Oe, 'auth_att' => 1, 'is_att' => 1 );
				$Op = serialize ( $lp );
				$lq = convert_uuencode ( $Op );
				engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( 'sitepagereview.rate.values', $lq );
				$Oq = convert_uuencode ( $Oe );
				engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( 'sitepagereview.view.info', $Oq );
				engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $O3 . '.lsettings', $l6 );
				engine_api::_ ()->sitepage ()->setmodpackageinfo ( 'sitepagereview', 1 );
				engine_api::_ ()->getdbtable ( 'Socialengineaddons', 'socialengineaddon' )->modActivate ( 'sitepagereview' );
				if (empty ( $O5 )) {
					$lr = explode ( '::', $get_value );
					if (! empty ( $lr )) {
						$lr = $lr [5 * 4 * 2 * 011 / 5 * 3 / 8 * 1 - 024 - 6];
					}
					$ls = Zend_Db_Table_Abstract::getdefaultadapter ();
					$O2 = engine_api::_ ()->getdbtable ( 'menuItems', 'core' );
					$Os = $O2->info ( 'name' );
					$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'core_admin_main_plugins_sitepagereview' );
					$lt = $select->query ()->fetchall ();
					if (empty ( $lt )) {
						$lr = explode ( ';', $lr );
						foreach ( $lr as $Ot ) {
							if (! empty ( $Ot )) {
								$ls->query ( $Ot );
							}
						}
					}
					$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'sitepagereview_admin_main_params' );
					$lt = $select->query ()->fetchall ();
					if (empty ( $lt )) {
						$lu = $O2->createrow ();
						$lu->name = 'sitepagereview_admin_main_params';
						$lu->module = 'sitepagereview';
						$lu->label = 'Rating Parameters';
						$lu->plugin = '';
						$lu->params = '{"route":"admin_default","module":"sitepagereview","controller":"ratingparameter", "action":"manage"}';
						$lu->menu = 'sitepagereview_admin_main';
						$lu->submenu = '';
						$lu->order = 2;
						$lu->save ();
					}
					$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'sitepagereview_admin_main_widget' );
					$lt = $select->query ()->fetchall ();
					if (empty ( $lt )) {
						$lu = $O2->createrow ();
						$lu->name = 'sitepagereview_admin_main_widget';
						$lu->module = 'sitepagereview';
						$lu->label = 'Widget Settings';
						$lu->plugin = '';
						$lu->params = '{"route":"admin_default","module":"sitepagereview","controller":"settings", "action": "widget"}';
						$lu->menu = 'sitepagereview_admin_main';
						$lu->submenu = '';
						$lu->order = 3;
						$lu->save ();
					}
					$select = $O2->select ()->from ( $Os, array ('id' ) )->where ( 'name = ?', 'sitepagereview_admin_main_manage' );
					$lt = $select->query ()->fetchall ();
					if (empty ( $lt )) {
						$lu = $O2->createrow ();
						$lu->name = 'sitepagereview_admin_main_manage';
						$lu->module = 'sitepagereview';
						$lu->label = 'Manage Ratings & Reviews';
						$lu->plugin = '';
						$lu->params = '{"route":"admin_default","module":"sitepagereview","controller":"manage", "action":"manage"}';
						$lu->menu = 'sitepagereview_admin_main';
						$lu->submenu = '';
						$lu->order = 4;
						$lu->save ();
					}
					include APPLICATION_PATH . '/application/modules/Sitepagereview/controllers/license/widgetSettings.php';
					if (! empty ( $O6 )) {
						$O14 = APPLICATION_PATH . '/application/settings/general.php';
						if (file_exists ( $O14 )) {
							$l15 = include $O14;
						} else {
							$l15 = array ();
						}
						if (! is_writable ( $O14 )) {
							@chmod ( $O14, 0666 );
						}
						$l15 ['environment_mode'] = 'development';
						$O15 = '<?php defined("_ENGINE") or die("Access Denied"); return ';
						$O15 .= var_export ( $l15, TRUE );
						$O15 .= '; ?>';
						@file_put_contents ( $O14, $O15 );
					}
					engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $O3 . '.navi.auth', 1 );
					engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $O3 . '.isActivate', 1 );
					$this->_helper->redirector->gotoroute ( array ('route' => 'admin-default' ) );
				} else {
					if ($this->getrequest ()->ispost () && $form->isvalid ( $this->getrequest ()->getpost () )) {
						$values = $_POST;
						foreach ( $values as $key => $value ) {
							if ($key != 'submit') {
								engine_api::_ ()->getapi ( 'settings', 'core' )->setsetting ( $key, $value );
							}
						}
					}
				}
				$l4 = FALSE;
			} elseif (strstr ( $get_value, 'error' )) {
				$l4 = str_replace ( 'error::', '', $get_value );
			} else {
				$l4 = 'This license key is not valid';
			}
		}
	}
	if (! empty ( $lj )) {
		$le = 1;
		$this->view->status = FALSE;
		$form->getdecorator ( 'errors' )->setoption ( 'escape', FALSE );
		$error = $lj;
		$error = Zend_Registry::get ( 'Zend_Translate' )->_ ( $error );
		$form->adderror ( $error );
		return;
	} else if (! empty ( $l4 )) {
		$le = 1;
		$this->view->status = FALSE;
		$form->getdecorator ( 'errors' )->setoption ( 'escape', FALSE );
		$error = $l4;
		$error = Zend_Registry::get ( 'Zend_Translate' )->_ ( $error );
		$form->adderror ( $error );
		return;
	}
 endif;
?>
